Explorar o código

refactor: remove unnecessary argument

Evan You %!s(int64=8) %!d(string=hai) anos
pai
achega
35e55ecd42
Modificáronse 1 ficheiros con 3 adicións e 7 borrados
  1. 3 7
      src/platforms/web/runtime/modules/dom-props.js

+ 3 - 7
src/platforms/web/runtime/modules/dom-props.js

@@ -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 {
@@ -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)
   ))