mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-22 08:40:34 +03:00
Merge pull request #90 from any35/master
In some case, we do need a clean tag without any other redundancy attributes.
This commit is contained in:
@@ -19,6 +19,7 @@ export default function _tagGenerator (options = {}) {
|
|||||||
// these attributes are treated as children on the tag
|
// these attributes are treated as children on the tag
|
||||||
case 'innerHTML':
|
case 'innerHTML':
|
||||||
case 'cssText':
|
case 'cssText':
|
||||||
|
case 'once':
|
||||||
return attrsStr
|
return attrsStr
|
||||||
|
|
||||||
// these form the attribute list for this tag
|
// these form the attribute list for this tag
|
||||||
@@ -35,10 +36,15 @@ export default function _tagGenerator (options = {}) {
|
|||||||
// these tag types will have content inserted
|
// these tag types will have content inserted
|
||||||
const closed = ['noscript', 'script', 'style'].indexOf(type) === -1
|
const closed = ['noscript', 'script', 'style'].indexOf(type) === -1
|
||||||
|
|
||||||
|
// generate tag exactly without any other redundance attribute
|
||||||
|
const observeTag = tag.once
|
||||||
|
? ''
|
||||||
|
: `${attribute}="true" `
|
||||||
|
|
||||||
// the final string for this specific tag
|
// the final string for this specific tag
|
||||||
return closed
|
return closed
|
||||||
? `${tagsStr}<${type} ${attribute}="true" ${attrs}/>`
|
? `${tagsStr}<${type} ${observeTag}${attrs}/>`
|
||||||
: `${tagsStr}<${type} ${attribute}="true" ${attrs}>${content}</${type}>`
|
: `${tagsStr}<${type} ${observeTag}${attrs}>${content}</${type}>`
|
||||||
}, '')
|
}, '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user