We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
动态加载的tree数据 设置默认的时候失效,不能默认选中,大家有遇到这个问题吗
The text was updated successfully, but these errors were encountered:
是的,我也遇到了,你解决了吗?
Sorry, something went wrong.
@lingdayan @canyuegongzi
watch改成如下:
watch: { value() { this.valueId = this.value; this.initHandle(); }, options: { handler(newValue, oldValue) { this.valueId = this.value; this.initHandle(); }, deep: true } },
methods 里面 initHandle函数改成如下:
// 初始化值 initHandle() { if (this.valueId) { this.$nextTick(() => { let node = this.$refs.selectTree.getNode(this.valueId); if (node != null) { this.valueTitle = node.data[this.props.label]; // 初始化显示 this.$refs.selectTree.setCurrentKey(this.valueId); // 设置默认选中 this.defaultExpandedKey = [this.valueId]; // 设置默认展开 } }); } else { this.valueTitle = ""; // 清除缓存显示 } this.initScroll(); },
No branches or pull requests
动态加载的tree数据 设置默认的时候失效,不能默认选中,大家有遇到这个问题吗
The text was updated successfully, but these errors were encountered: