Prechádzať zdrojové kódy

only sync inline value on init for checkbox/radio (fix #1985)

Evan You 10 rokov pred
rodič
commit
746e17aec1

+ 1 - 1
src/directives/public/model/checkbox.js

@@ -47,7 +47,7 @@ export default {
     }
     }
 
 
     this.on('change', this.listener)
     this.on('change', this.listener)
-    if (el.checked) {
+    if (el.hasAttribute('checked')) {
       this.afterBind = this.listener
       this.afterBind = this.listener
     }
     }
   },
   },

+ 1 - 1
src/directives/public/model/radio.js

@@ -23,7 +23,7 @@ export default {
     }
     }
     this.on('change', this.listener)
     this.on('change', this.listener)
 
 
-    if (el.checked) {
+    if (el.hasAttribute('checked')) {
       this.afterBind = this.listener
       this.afterBind = this.listener
     }
     }
   },
   },