普通树状
<el-form-item label="组织机构" prop="orgId">
<el-cascader
size="small"
class="organization"
v-model="ruleForm.orgId"
:props="orgCode"
:options="orgIdArr"
@change="handleChange"
placeholder="请输入组织机构"
clearable >
</el-cascader>
</el-form-item>
data(){
return {
orgCode: {
label: "name",
value: "id",
children: "children",
checkStrictly: true,
}
},
懒加载树桩
<el-cascader
size="small"
class="organization"
v-model="ruleForm.areaCode"
:options="areaCodeArr"
:props="nameCode"
placeholder="请输入所属地区"
clearable
@change="handleChangeRegion" >
</el-cascader>
</el-form-item>
data(){
return {
nameCode: {
label: "name",
value: "code",
children: "children",
checkStrictly: true,
lazy: true,
expandTrigger:'hover',
checkStrictly :true,
async lazyLoad (node, resolve) {
if(node.level>0){
let obj = {code:node.value}
let {data} = await get('sys-area/lazy',obj)
resolve(data);
}
}
},
}
}
element el-Cascader 级联选择器
最新推荐文章于 2024-08-06 15:03:02 发布