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:
@@ -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' }]
|
||||
})
|
||||
|
||||
|
||||
@@ -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' }
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user