1 回答
守着星空守着你
TA贡献1799条经验 获得超8个赞
<el-tree :props="props1" :load="loadNode1" lazy="" show-checkbox>
var Main = {
data() { return { props1: { label: 'name', children: 'zones', isLeaf: 'leaf' }, }; }, methods: { loadNode1(node, resolve) { if (node.level === 0) { return resolve([{ name: 'region' }]); } if (node.level > 2) return resolve([]); setTimeout(() => { const data = [{ name: 'leaf', leaf: true }, { name: 'zone' }]; resolve(data); }, 500); } }
};
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
添加回答
举报
0/150
提交
取消