<template>
<div>
  <el-cascader
   :props="{ checkStrictly: true }"
    clearable
    placeholder="请选择镇村"
    v-model="value"
    :options="options"
    size="mini"
    @change="handleChange"></el-cascader>

 </div>
</template>



<script>
  export default {
    data() {
      return {
        value: [],
        options:[]
      };
    },
    methods: {
      handleChange(value) {
        this.$emit('childByValue', value)
      },

    },
    created(){
         this.$api.getlist.getTown().then((res) => {

            this.options=res.data
            console.log(res.data)
           this.$emit('getTownlength', this.options.length)

        }).catch((res) => {

        })
    }
  };
</script>
