2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-23 12:20:33 +03:00
This commit is contained in:
Sebastien Chopin
2017-05-15 14:43:01 +02:00
parent effa0e88a1
commit e9f5bf093f
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -19,6 +19,10 @@ new Vue({
}, },
meta: [ meta: [
{ name: 'description', content: 'Hello', vmid: 'test' } { name: 'description', content: 'Hello', vmid: 'test' }
] ],
script: [
{ innerHTML: '{ "@context": "http://www.schema.org", "@type": "Organization" }', type: 'application/ld+json' }
],
__dangerouslyDisableSanitizers: ['script']
}) })
}).$mount('#app') }).$mount('#app')
+1 -1
View File
@@ -34,10 +34,10 @@ export default function _updateTags (options = {}) {
if (tags && tags.length) { if (tags && tags.length) {
tags.forEach((tag) => { tags.forEach((tag) => {
if (type === '__dangerouslyDisableSanitizers') return
const newElement = document.createElement(type) const newElement = document.createElement(type)
for (const attr in tag) { for (const attr in tag) {
console.log(type, attribute, attr)
if (tag.hasOwnProperty(attr)) { if (tag.hasOwnProperty(attr)) {
if (attr === 'innerHTML') { if (attr === 'innerHTML') {
newElement.innerHTML = tag.innerHTML newElement.innerHTML = tag.innerHTML