Merge pull request #11 from wenhanhan/master

fix-bug -- 使用TreeSelect组件后,重置按钮无法置空该组件值
master
若依 3 years ago committed by GitHub
commit 9f1030d222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/TreeSelect/index.vue

@ -82,13 +82,15 @@ const defaultExpandedKey = ref([]);
function initHandle() { function initHandle() {
nextTick(() => { nextTick(() => {
const selectedValue = valueId.value; const selectedValue = valueId.value;
if(selectedValue !== null && typeof (selectedValue) !== "undefined"){ if(selectedValue && selectedValue !== null && typeof (selectedValue) !== "undefined"){
const node = proxy.$refs.selectTree.getNode(selectedValue) const node = proxy.$refs.selectTree.getNode(selectedValue)
if (node) { if (node) {
valueTitle.value = node.data[props.objMap.label] valueTitle.value = node.data[props.objMap.label]
proxy.$refs.selectTree.setCurrentKey(selectedValue) // proxy.$refs.selectTree.setCurrentKey(selectedValue) //
defaultExpandedKey.value = [selectedValue] // defaultExpandedKey.value = [selectedValue] //
} }
}else{
clearHandle()
} }
}) })
} }

Loading…
Cancel
Save