Преглед изворни кода

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

Evan You пре 10 година
родитељ
комит
746e17aec1
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/directives/public/model/checkbox.js
  2. 1 1
      src/directives/public/model/radio.js

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

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

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

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