2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-01 16:24:04 +03:00

generate valid HTML on server-side

This commit is contained in:
Sebastien Chopin
2017-05-16 17:21:14 +02:00
parent fba3c42287
commit d081805c77
+3 -1
View File
@@ -21,9 +21,11 @@ export default function _tagGenerator (options = {}) {
case 'cssText':
case 'once':
return attrsStr
// these form the attribute list for this tag
default:
if (attr === options.tagIDKeyName) {
return `${attrsStr} data-${attr}="${tag[attr]}"`
}
return typeof tag[attr] === 'undefined'
? `${attrsStr} ${attr}`
: `${attrsStr} ${attr}="${tag[attr]}"`