2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-17 18:20:34 +03:00

feat: add support for setting attributes from multiple apps

chore: improve build size
This commit is contained in:
pimlie
2019-09-13 13:09:22 +02:00
committed by Pim
parent 0ab76ee16b
commit d9b0ab29da
16 changed files with 251 additions and 77 deletions
+10
View File
@@ -69,6 +69,7 @@ export default function createApp () {
return {
title: 'Boring Title',
htmlAttrs: { amp: true },
bodyAttrs: { class: 'main-app' },
meta: [
{
skip: this.count < 1,
@@ -116,6 +117,14 @@ export default function createApp () {
users: process.server ? [] : window.users
}
},
mounted() {
const { set, remove } = this.$meta().addApp('client-only')
set({
bodyAttrs: { class: 'client-only' }
})
setTimeout(() => remove(), 3000)
},
methods: {
loadCallback () {
this.count++
@@ -140,6 +149,7 @@ export default function createApp () {
const { set } = app.$meta().addApp('custom')
set({
bodyAttrs: { class: 'custom-app' },
meta: [{ charset: 'utf-8' }]
})
+6
View File
@@ -18,6 +18,9 @@ const ChildComponent = {
metaInfo () {
return {
title: `${this.page} - ${this.date && this.date.toTimeString()}`,
bodyAttrs: {
class: 'child-component'
},
afterNavigation () {
metaUpdated = 'yes'
}
@@ -82,6 +85,9 @@ const app = new Vue(App)
const { set, remove } = app.$meta().addApp('custom')
set({
bodyAttrs: {
class: 'custom-app'
},
meta: [
{ charset: 'utf=8' }
]