fix(runtime-dom/ssr): properly handle xlink and boolean attributes

This commit is contained in:
Evan You
2020-01-28 22:03:53 -05:00
parent 6f43c4b516
commit e6e2c58234
3 changed files with 38 additions and 22 deletions

View File

@@ -30,7 +30,9 @@ export function renderProps(
? key
: propsToAttrMap[key] || key.toLowerCase()
if (isBooleanAttr(attrKey)) {
ret += ` ${attrKey}=""`
if (value !== false) {
ret += ` ${attrKey}`
}
} else if (isSSRSafeAttrName(attrKey)) {
ret += ` ${attrKey}="${escape(value)}"`
}