1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <template>
- <div :id="'AS-' + _uid"></div>
- </template>
- <script>
- import $ from 'jquery'
- import './jquery.addressSelect'
- // Andste_TODO 2018/5/28: 传参待优化
- export default {
- name: 'EnRegionPicker',
- props: {
- default: {
- default: null
- },
- api: {
- type: String,
- required: true
- }
- },
- watch: {
- default: function () {
- this.initAddressSelect()
- }
- },
- mounted: function () {
- this.initAddressSelect()
- },
- methods: {
- callback: function (object) {
- this.$emit('input', object.last_id)
- this.$emit('changed', object)
- },
- initAddressSelect: function () {
- this.$nextTick(function () {
- $(this.$el).addressSelect({
- api: this.api,
- callback: this.callback,
- deData: this.default
- })
- })
- }
- }
- }
- </script>
|