wr1207
2023-04-17 32e4bad2cff2793052effcd2d59cdd8923702b22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
    <el-cascader :props="checkstrictly" @change="change" filterable style="width:100%" v-model="optiondata" clearable :options="addressOptions" cle></el-cascader>
</template>
 
<script>
export default {
    props: {
        type:{
            type:Number,
        },
        treeoption:{
            type:Array,
        },
        checkstrictly:{
            type:Object,
        },
        is_clear:{
            type:Boolean,
            default:false
        },
    },
    watch:{
        is_clear(val){
            if(val){
                this.addressOptions = []
            }
        }
    },
    data(){
        return{
            optiondata:this.treeoption,
            addressOptions:[],
        }
    },
    mounted(){
        this.init()
    },
    methods: {
        init(){
            this.$axios.post('/admin/Base/getShenshiqu',{type:this.type}).then(response => {
                this.addressOptions = response.data.data
            })
        },
        change(val){
            this.$emit('update:treeoption',val)
        }
    },
}
</script>