2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-24 23:10:33 +03:00
This commit is contained in:
Sébastien Chopin
2018-01-08 08:41:45 +01:00
parent 3eaf8a9b33
commit a9ba6f5aba
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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'