<template>
<div>
<el-cascader
@change='changeCascader'
:props="props"
clearable></el-cascader>
</div>
</template>
<script setup>
import { ref } from '@vue/reactivity'
let id = 0;
const props = ref({
checkStrictly: true ,
lazy:true,
lazyLoad(node,resolve){
const { level } = node;
if(level == 0){
// 第一层
resolve([{value:'1',label:'选项1',leaf: level >= 2}]);
}
if(level == 1){
// 第一层
resolve([{value:'1-1',label:'选项1-1',leaf: level >= 2}]);
}
if(level == 2){
// 第一层
resolve([{value:'1-1-1',label:'选项1-1-1',leaf: level >= 2}]);
}
}
})
</script>
网友评论