Sfoglia il codice sorgente

fix v-model text initial value check

Evan You 11 anni fa
parent
commit
74675a1e5a
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/directives/model/text.js

+ 4 - 1
src/directives/model/text.js

@@ -90,7 +90,10 @@ module.exports = {
     }
 
     // set initial value if present
-    if (el.value) {
+    if (
+      el.hasAttribute('value') ||
+      el.tagName === 'TEXTAREA'
+    ) {
       // watcher is not set up yet
       this.vm.$set(this.expression, el.value)
     }