级联选择器

const props = { lazy: true, value: 'id', label: 'name', leaf: 'leaf', async lazyLoad(node, resolve) { // 加载数据的方法 if (typeof node.value == 'undefined') node.value = 0 const { data } = await FindCategoryByParentId(node.value) data.forEach(function(item) { //hasChildren判断是否有子节点 item.leaf = !item.hasChildren leaf 值为 false(可展开),Node 2 的 leaf 值为 true(不可展开) }) resolve(data) // 返回数据
} };

0个评论
点击登录,快来和大家讨论吧~
表情
图片
暂无评论
下载 APP