export default{ ... return ..略... column: 略 ... //字段开始 { label: '设备型号', prop: 'brandModelId', type: "cascader", props: { label: 'brandName', value: 'id' }, lazy: true, lazyLoad(node, resolve) { let stop_level = 2; let level = node.level; console.log("levelId!!!!!!!!!!!!" + level); let data = node.data || {} //let code = data.code; let list = []; let callback = () => { resolve((list || []).map(ele => { return Object.assign(ele, { leaf: level >= stop_level }) })); } if (level == 0) { axios.get(`/api/maintainer/brand/getList`).then(res => { list = res.data.data; callback() }) } if (level == 1) { axios.get(`/api/maintainer/brand/getList`).then(res => { list = res.data.data; callback() }) } } }
进不去这个lazyLoad方法
扫一扫访问 Blade技术社区 移动端