Element: el-input currentValue 和value值不同

Created on 27 May 2017  ·  1Comment  ·  Source: ElemeFE/element

currentValue和v-model的值不同,导致页面显示的不是v-model的值。

代码如下:
//页面

//directive
Vue.directive('number', {
update(el, binding, vnode) {
const value = binding.value
if (value === '') {
Vue.set(vnode.context, binding.expression, '')
} else if (!Number(value)) {
Vue.set(vnode.context, binding.expression, 0)
}
}
});

发现将v-model更新为0之后,再接着输入,不会再次更新为0。此时el-input的currentValue和value的值是不同的。如果用原生input绑定自定义的指令是没有出现此bug

>All comments

Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.

Was this page helpful?
0 / 5 - 0 ratings