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

make boolean attributes html5 spec compatible #2169

rhyzx 10 лет назад
Родитель
Сommit
1d4ea8e785
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/directives/public/bind.js

+ 2 - 2
src/directives/public/bind.js

@@ -132,9 +132,9 @@ export default {
         }
         setClass(el, value)
       } else if (xlinkRE.test(attr)) {
-        el.setAttributeNS(xlinkNS, attr, value)
+        el.setAttributeNS(xlinkNS, attr, value === true ? '' : value)
       } else {
-        el.setAttribute(attr, value)
+        el.setAttribute(attr, value === true ? '' : value)
       }
     } else {
       el.removeAttribute(attr)