fix: input trigger multiple change event

pull/398/head
tangjinzhou 2019-01-07 20:56:32 +08:00
parent b2d6577b76
commit 948499a730
2 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,8 @@ import inputProps from './inputProps'
import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util'
import { isIE, isIE9 } from '../_util/env'
function noop () {}
function fixControlledValue (value) {
if (typeof value === 'undefined' || value === null) {
return ''
@ -184,6 +186,7 @@ export default {
...$listeners,
keydown: handleKeyDown,
input: handleChange,
change: noop,
},
class: classNames(getInputClassName(), getClass(this)),
ref: 'input',

View File

@ -25,6 +25,7 @@ function fixControlledValue (value) {
}
return value
}
function noop () {}
export default {
name: 'ATextarea',
@ -165,6 +166,7 @@ export default {
...$listeners,
keydown: handleKeyDown,
input: handleTextareaChange,
change: noop,
},
}
if ($listeners['change.value']) {