<template>
	<div>
        <template v-for="(list, level) in options">
            <el-select
                :key="list.id"
                v-model="selectedIndex[level]"
                placeholder="请选择"
            >
                <el-option
                    v-for="item in list"
                    :key="item.id"
                    :label="item.titleZh"
                    :value="item.id"
                >
                </el-option>
            </el-select>
        </template>
	</div>
</template>
<script>
import { getListTree } from "@/api/ecw/region";
// 洲，国，省，市，区
export default {
    props:{
        continent: {
            type: Number,
            default: 1
        }, // 0 从洲开始，1从国家开始,
        type: String, // 进出口类型
        
    },
	data() {
		return {
            treeList: [],
			selectedIndex:[],
            options:[]
		};
	},
    watch:{
        treeList(){
            this.selectedIndex = []
            this.options = [
                this.treeList
            ]
        },
        selectedIndex(val, old){
            
        }
    },
    created(){
        getListTree({
            treeType: this.treeType,
            type: this.type
        }).then((response) => {
            this.treeList = response.data;
        });
    },
	methods: {
		
	},
};
</script>