2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-21 23:20:33 +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 'cssText':
case 'once': case 'once':
return attrsStr return attrsStr
// these form the attribute list for this tag // these form the attribute list for this tag
default: default:
if (attr === options.tagIDKeyName) {
return `${attrsStr} data-${attr}="${tag[attr]}"`
}
return typeof tag[attr] === 'undefined' return typeof tag[attr] === 'undefined'
? `${attrsStr} ${attr}` ? `${attrsStr} ${attr}`
: `${attrsStr} ${attr}="${tag[attr]}"` : `${attrsStr} ${attr}="${tag[attr]}"`