1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <el-cascader
- v-model="newValue"
- :options="options"
- :props="config"
- style="width: 100%;"
- v-bind="$attrs"
- ></el-cascader>
- </template>
- <script>
- import REGION from '@/const/region.json';
- export default {
- name: 'BaseBtn',
- props: {
- value: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- newValue: this.value,
- options: REGION,
- config: {
- value: 'name',
- label: 'name'
- }
- };
- },
- watch: {
- value: {
- handler(val) {
- this.newValue = val;
- },
- immediate: true
- },
- newValue(val) {
- this.$emit('input', val);
- }
- },
- methods: {}
- };
- </script>
- <style lang="scss" scoped></style>
|