Element-plus Cascader级联选择器动态加载模式下数据回显时的问题
页面内容:
<el-cascader v-model="warehouseModel.warehouseAddress"
:props="areaProps"
placeholder="请选择省/市/区"
></el-cascader>
const areaProps = { lazy: true,
async lazyLoad(node: any, resolve: any) {
const { level, data } = node;
let nodes;
switch (level) {
case 0:
nodes = await useProvince();
break;
case 1:
nodes = await useCity(data.value.key);
break;
case 2:
nodes = await useRegion(data.value.key);
break;
}
resolve(nodes);
},
};
数据回显的时候v-model的方式绑定初始值:
e.g.
// warehouseModel.warehouseAddress[
{"key":"440000","value":"广东省"},
{"key":"441600","value":"河源市"},
{"key":"441625","value":"东源县"}
]
问题:
发现接口存在多次重复调用且每次调用可能还不一样的情况
回答:
这个不知对你是否有帮助
https://www.cnblogs.com/orzzt...
以上是 Element-plus Cascader级联选择器动态加载模式下数据回显时的问题 的全部内容, 来源链接: utcz.com/p/937100.html