提交 52670a2e 编写于 作者: Q qiang

fix: 解决 textarea 组件的 input 事件某些情况不触发的问题

上级 8d9e5e44
......@@ -150,7 +150,8 @@ export default {
this.valueSync = String(val)
},
valueSync (val) {
if (val !== this.value) {
if (val !== this._oldValue) {
this._oldValue = val
this.$trigger('input', {}, {
value: val,
cursor: this.$refs.textarea.selectionEnd
......@@ -204,7 +205,7 @@ export default {
})
},
mounted () {
this.$refs.textarea.value = this.valueSync
this._oldValue = this.$refs.textarea.value = this.valueSync
this._resize({
height: this.$refs.sensor.$el.offsetHeight
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册