@@ -36,8 +36,8 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
3636 // avoid resetting cursor position when value is the same
3737 const strCur = cur == null ? '' : String ( cur )
3838 if ( ! elm . composing && (
39- ( document . activeElement !== elm && elm . value !== strCur ) ||
40- isValueChanged ( vnode , strCur )
39+ ( document . activeElement !== elm && elm . value !== strCur ) ||
40+ isValueChanged ( vnode , strCur )
4141 ) ) {
4242 elm . value = strCur
4343 }
@@ -49,7 +49,7 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
4949
5050function isValueChanged ( vnode : VNodeWithData , newVal : string ) : boolean {
5151 const value = vnode . elm . value
52- const modifiers = getModelModifier ( vnode )
52+ const modifiers = vnode . elm . _vModifiers // injected by v-model runtime
5353 if ( ( modifiers && modifiers . number ) || vnode . elm . type === 'number' ) {
5454 return toNumber ( value ) !== toNumber ( newVal )
5555 }
@@ -59,17 +59,6 @@ function isValueChanged (vnode: VNodeWithData, newVal: string): boolean {
5959 return value !== newVal
6060}
6161
62- function getModelModifier ( vnode : VNodeWithData ) : ?ASTModifiers {
63- const directives = vnode . data . directives
64- if ( ! directives ) return
65- for ( let i = 0 , directive ; i < directives . length ; i ++ ) {
66- directive = directives [ i ]
67- if ( directive . name === 'model' ) {
68- return directive . modifiers
69- }
70- }
71- }
72-
7362export default {
7463 create : updateDOMProps ,
7564 update : updateDOMProps
0 commit comments