Open FKdamn opened 10 months ago
<treeselect style="width: 340px; height: 36px" v-model="queryParams.deptId" :options="menuOptions" :normalizer="normalizer" :async="true" :load-options="loadOptions" placeholder="选择上级部门"/> 加了:async="true"之后懒加载失效了 如果去掉这个懒加载又可以了,请问是什么问题 附: loadOptions的代码: loadOptions({ action, parentNode, searchQuery, callback }){ if(action === 'LOAD_CHILDREN_OPTIONS'){ getSealParentDept(parentNode.deptId).then(response => { // 子集树数据 parentNode.children = this.getTreeData(response.data); callback(); }) } else if(action === 'ASYNC_SEARCH'){ queryDeptByName(searchQuery).then(response => { if (response.data) { callback(null, this.getTreeData(response.data)); } }) } }, normalizer的代码: normalizer(node) { return { id:node.deptId, // isDisabled:node.disabled, label: node.deptName, children: node.children } },
<treeselect style="width: 340px; height: 36px" v-model="queryParams.deptId" :options="menuOptions" :normalizer="normalizer" :async="true" :load-options="loadOptions" placeholder="选择上级部门"/> 加了:async="true"之后懒加载失效了 如果去掉这个懒加载又可以了,请问是什么问题 附: loadOptions的代码: loadOptions({ action, parentNode, searchQuery, callback }){ if(action === 'LOAD_CHILDREN_OPTIONS'){ getSealParentDept(parentNode.deptId).then(response => { // 子集树数据 parentNode.children = this.getTreeData(response.data); callback(); }) } else if(action === 'ASYNC_SEARCH'){ queryDeptByName(searchQuery).then(response => { if (response.data) { callback(null, this.getTreeData(response.data)); } }) } }, normalizer的代码: normalizer(node) { return { id:node.deptId, // isDisabled:node.disabled, label: node.deptName, children: node.children } },