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
请教一下,为什么 DatetimePicker.prototype.clear 方法不直接 this.value = null, 而一定要在所有引用Datetime 组件的地方手工传入 on-clear 函数?这样感觉有点麻烦且重复劳动, on-clear 函数应该是做在value清空时后续custom操作的地方。
src/components/datetime/datetimepicker.js
clear () { const value = this.getValue() // this.value = null //这样写会有什么问题么?本来就是clear函数,清空value就是它应该做的事情 if (this.config.onClear.call(this, null) === false) { return } this.hide('clear') }
The text was updated successfully, but these errors were encountered:
结合这个函数上方的 confirm 操作来看,这里是可以直接赋值 this.value 的。至于后面的 onClear 只是为了触发调用该 js 的 vue 实例做相关操作。
Sorry, something went wrong.
No branches or pull requests
请教一下,为什么 DatetimePicker.prototype.clear 方法不直接 this.value = null, 而一定要在所有引用Datetime 组件的地方手工传入 on-clear 函数?这样感觉有点麻烦且重复劳动, on-clear 函数应该是做在value清空时后续custom操作的地方。
src/components/datetime/datetimepicker.js
The text was updated successfully, but these errors were encountered: