Skip to content
New issue

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

点击清除按钮无法清空父组件绑定的值 #725

Closed
MCZeroDu opened this issue Mar 23, 2023 · 3 comments
Closed

点击清除按钮无法清空父组件绑定的值 #725

MCZeroDu opened this issue Mar 23, 2023 · 3 comments

Comments

@MCZeroDu
Copy link

image

@zqy233
Copy link
Contributor

zqy233 commented Mar 23, 2023

因为源码是这样的,先调用clear方法,再清空值,我觉得是想把清空前的值交给用户

clear() {
	this.$emit("clear", {
	value: this.searchVal
	})
	this.searchVal = ""
},

@MCZeroDu
Copy link
Author

既然是清空操作 应该把空值反馈给父组件,而不是把清空之前的值反馈给父组件;源码把 this.searchVal = "" 放到了 this.$emit 后面,searchVal 值得通过了 watch 监听通知父组件的。

image

@18148764734
Copy link
Contributor

感谢反馈,现已修复,请到插件市场更新!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants