[Bug Report] Cascader getCheckedNodes 在搜索后,在触发的change事件中无法获取到选中的节点
Element UI version
2.9.2
OS/Browsers version
window10 chrome
Vue version
2.6.10
Reproduction Link
https://jsfiddle.net/robinwpzan/4tqvpcu7/4/
Steps to reproduce
搜索,选择一个节点,在change事件中,getCheckedNodes 方法获取选中的节点。 结果打印出选中的节点是空。 需要在this.$nextTick中调用getCheckedNodes 方法才能获取到节点信息
What is Expected?
能获取到当前选中的节点
What is actually happening?
不能获取到当前选中的节点
Translation of this issue:
Element UI version
2.9.2
OS/Browsers version
window10 chrome
Vue version
2.6.10
Reproduction Link
https://jsfiddle.net/robinwpzan/4tqvpcu7/4/
Steps to reproduce
Search, select a node, in the change event, getcheckednodes method gets the selected node.
The result prints out that the selected node is empty. You need to call the getCheckedNodes method in this.$nextTick to get the node information.
What is Expected?
Can get the currently selected node
What is actually happening?
Cannot get the currently selected node
I have common problem
https://github.com/ElemeFE/element/blob/1b1c1beadc9333e7b210d424db465a18f8b19995/packages/cascader-panel/src/cascader-panel.vue#L154
you may invoke getCheckedNodes method of cascader on change when you set the filterable mode. In fact, getCheckedNodes method of cascader invoke a method with the same name of cascader-panel At that time, checkedValue of cascader has been updated but checkedValue of cascader-panel hasn't.
same problem
same problem
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
handleChange(value) { this.$nextTick(() => { this.$refs['cascader'].getCheckedNodes() }) }