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

feat: convert to ts (wip)

This commit is contained in:
pimlie
2020-06-01 01:05:59 +02:00
parent 303eae1603
commit 28d3fc1923
106 changed files with 4478 additions and 5037 deletions
+14 -14
View File
@@ -6,50 +6,50 @@ Vue.use(VueMeta)
// index.html contains a manual SSR render
const app1 = new Vue({
metaInfo () {
metaInfo() {
return {
title: 'App 1 title',
bodyAttrs: {
class: 'app-1'
class: 'app-1',
},
meta: [
{ name: 'description', content: 'Hello from app 1', vmid: 'test' },
{ name: 'og:description', content: this.ogContent }
{ name: 'og:description', content: this.ogContent },
],
script: [
{ innerHTML: 'var appId=1.1', body: true },
{ innerHTML: 'var appId=1.2', vmid: 'app-id-body' }
]
{ innerHTML: 'var appId=1.2', vmid: 'app-id-body' },
],
}
},
data () {
data() {
return {
ogContent: 'Hello from ssr app'
ogContent: 'Hello from ssr app',
}
},
template: `
<div id="app1"><h1>App 1</h1></div>
`
`,
})
const app2 = new Vue({
metaInfo: () => ({
title: 'App 2 title',
bodyAttrs: {
class: 'app-2'
class: 'app-2',
},
meta: [
{ name: 'description', content: 'Hello from app 2', vmid: 'test' },
{ name: 'og:description', content: 'Hello from app 2' }
{ name: 'og:description', content: 'Hello from app 2' },
],
script: [
{ innerHTML: 'var appId=2.1', body: true },
{ innerHTML: 'var appId=2.2', vmid: 'app-id-body', body: true }
]
{ innerHTML: 'var appId=2.2', vmid: 'app-id-body', body: true },
],
}),
template: `
<div id="app2"><h1>App 2</h1></div>
`
`,
}).$mount('#app2')
app1.$mount('#app1')
@@ -57,7 +57,7 @@ app1.$mount('#app1')
const app3 = new Vue({
template: `
<div id="app3"><h1>App 3 (empty metaInfo)</h1></div>
`
`,
}).$mount('#app3')
setTimeout(() => {