AddressSelect.vue 731 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <el-cascader
  3. v-model="newValue"
  4. :options="options"
  5. :props="config"
  6. style="width: 100%;"
  7. v-bind="$attrs"
  8. ></el-cascader>
  9. </template>
  10. <script>
  11. import REGION from '@/const/region.json';
  12. export default {
  13. name: 'BaseBtn',
  14. props: {
  15. value: {
  16. type: Array,
  17. default: () => []
  18. }
  19. },
  20. data() {
  21. return {
  22. newValue: this.value,
  23. options: REGION,
  24. config: {
  25. value: 'name',
  26. label: 'name'
  27. }
  28. };
  29. },
  30. watch: {
  31. value: {
  32. handler(val) {
  33. this.newValue = val;
  34. },
  35. immediate: true
  36. },
  37. newValue(val) {
  38. this.$emit('input', val);
  39. }
  40. },
  41. methods: {}
  42. };
  43. </script>
  44. <style lang="scss" scoped></style>