2
0
Эх сурвалжийг харах

make boolean attributes html5 spec compatible #2169

rhyzx 10 жил өмнө
parent
commit
1d4ea8e785

+ 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)