Просмотр исходного кода

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

Evan You 10 лет назад
Родитель
Сommit
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
     }
   },