[update] 修改bug87605
This commit is contained in:
@@ -23,9 +23,11 @@
|
|||||||
@check="onCheck"
|
@check="onCheck"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
@expand="onExpand"
|
@expand="onExpand"
|
||||||
|
@load="onLoad"
|
||||||
:loadData="loadData"
|
:loadData="loadData"
|
||||||
:expandedKeys="expandedKeys"
|
:expandedKeys="expandedKeys"
|
||||||
:checkedKeys="checkedKeys"
|
:checkedKeys="checkedKeys"
|
||||||
|
:loadedKeys="loadedKeys"
|
||||||
:selectedKeys.sync="selectedKeys">
|
:selectedKeys.sync="selectedKeys">
|
||||||
|
|
||||||
<template slot="title" slot-scope="{dataRef}">
|
<template slot="title" slot-scope="{dataRef}">
|
||||||
@@ -175,6 +177,7 @@ export default {
|
|||||||
checkedKeys: [],
|
checkedKeys: [],
|
||||||
checkedRows: [],
|
checkedRows: [],
|
||||||
selectedKeys: [],
|
selectedKeys: [],
|
||||||
|
loadedKeys: [],
|
||||||
searchValue: '', // 查询框内容
|
searchValue: '', // 查询框内容
|
||||||
replaceFields: {},
|
replaceFields: {},
|
||||||
dataSourceRight: [],
|
dataSourceRight: [],
|
||||||
@@ -324,11 +327,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad (loadedKeys) {
|
||||||
|
this.loadedKeys = loadedKeys
|
||||||
|
},
|
||||||
onExpand (expandedKeys) {
|
onExpand (expandedKeys) {
|
||||||
|
console.log('========expandedKeys', expandedKeys)
|
||||||
this.expandedKeys = expandedKeys
|
this.expandedKeys = expandedKeys
|
||||||
},
|
},
|
||||||
// 异步加载
|
// 异步加载
|
||||||
async loadData (node) {
|
async loadData (node) {
|
||||||
|
console.log('-------------loadData', node)
|
||||||
if (node.dataRef.children) {
|
if (node.dataRef.children) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -364,14 +372,18 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
this.checkedKeys = []
|
this.checkedKeys = []
|
||||||
this.expandedKeys = []
|
this.expandedKeys = []
|
||||||
|
this.loadedKeys = []
|
||||||
this.dataSourceRight = []
|
this.dataSourceRight = []
|
||||||
this.treeData = []
|
this.treeData = []
|
||||||
this.searchValue = ''
|
this.searchValue = ''
|
||||||
},
|
},
|
||||||
onSearch (value) {
|
onSearch (value) {
|
||||||
this.searchValue = value
|
this.searchValue = value
|
||||||
this.autoExpandParent = true
|
// this.autoExpandParent = true
|
||||||
this.getTreeData()
|
this.getTreeData()
|
||||||
|
this.expandedKeys = []
|
||||||
|
this.loadedKeys = []
|
||||||
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
// 设置树只能选第三级
|
// 设置树只能选第三级
|
||||||
setOnlySelectThreeLevel (treeData) {
|
setOnlySelectThreeLevel (treeData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user