<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>
