class="filter-tree"
style="overflow: auto;margin-top:10px;"
:props="defaultProps"
:node-key="defaultProps.value"
highlight-current
:expand-on-click-node="true"
@node-click="handleNodeClick"
:lazy="true"
:load="lazyLoadTree"
:default-expanded-keys="defaultIdArr"
@node-contextmenu="rightClick"
ref="lazyLoadTree"
>
data() { return { defaultIdArr: [] }}
if (!node || node.data === undefined) {
this.defaultIdArr = [];
this.defaultIdArr.push(response.data[0].id);
//选中最外层的第一项
// this.$nextTick(() => {
// this.$refs.lazyLoadTree.setCurrentKey(response.data[0].id);
// });
// this.chooseItem = response.data[0];
this.sendPart(response.data[0]);
// var vm = this.$refs.lazyLoadTree;
// vm.root.setData(response.data);
// return;
}
if (node && node.level === 1) {
this.$nextTick(() => {
this.$refs.lazyLoadTree.setCurrentKey(response.data[0].id);
});
}
resolve(response.data);
element tree lazy 默认展开
最新推荐文章于 2024-04-08 10:08:23 发布