mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-25 00:20:33 +03:00
fix: Issue #178
This commit is contained in:
@@ -47,7 +47,7 @@ export default function _updateTags (options = {}) {
|
|||||||
} else {
|
} else {
|
||||||
newElement.appendChild(document.createTextNode(tag.cssText))
|
newElement.appendChild(document.createTextNode(tag.cssText))
|
||||||
}
|
}
|
||||||
} else if ([options.tagIDKeyName, 'body'].includes(attr)) {
|
} else if ([options.tagIDKeyName, 'body'].indexOf(attr) !== -1) {
|
||||||
const _attr = `data-${attr}`
|
const _attr = `data-${attr}`
|
||||||
const value = (typeof tag[attr] === 'undefined') ? '' : tag[attr]
|
const value = (typeof tag[attr] === 'undefined') ? '' : tag[attr]
|
||||||
newElement.setAttribute(_attr, value)
|
newElement.setAttribute(_attr, value)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function _tagGenerator (options = {}) {
|
|||||||
return attrsStr
|
return attrsStr
|
||||||
// these form the attribute list for this tag
|
// these form the attribute list for this tag
|
||||||
default:
|
default:
|
||||||
if ([options.tagIDKeyName, 'body'].includes(attr)) {
|
if ([options.tagIDKeyName, 'body'].indexOf(attr) !== -1) {
|
||||||
return `${attrsStr} data-${attr}="${tag[attr]}"`
|
return `${attrsStr} data-${attr}="${tag[attr]}"`
|
||||||
}
|
}
|
||||||
return typeof tag[attr] === 'undefined'
|
return typeof tag[attr] === 'undefined'
|
||||||
|
|||||||
Reference in New Issue
Block a user