Skip to content

Commit

Permalink
refactor: remove unnecessary argument
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 7, 2017
1 parent 96472be commit 35e55ec
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/platforms/web/runtime/modules/dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
elm._value = cur
// avoid resetting cursor position when value is the same
const strCur = isUndef(cur) ? '' : String(cur)
if (shouldUpdateValue(elm, vnode, strCur)) {
if (shouldUpdateValue(elm, strCur)) {
elm.value = strCur
}
} else {
Expand All @@ -53,13 +53,9 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
// check platforms/web/util/attrs.js acceptValue
type acceptValueElm = HTMLInputElement | HTMLSelectElement | HTMLOptionElement;

function shouldUpdateValue (
elm: acceptValueElm,
vnode: VNodeWithData,
checkVal: string
): boolean {
function shouldUpdateValue (elm: acceptValueElm, checkVal: string): boolean {
return (!elm.composing && (
vnode.tag === 'option' ||
elm.tagName === 'OPTION' ||
isDirty(elm, checkVal) ||
isInputChanged(elm, checkVal)
))
Expand Down

0 comments on commit 35e55ec

Please sign in to comment.