diff --git a/.circleci/config.yml b/.circleci/config.yml
index fff8d14..e350458 100755
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -52,7 +52,7 @@ jobs:
- attach-project
- run:
name: Security Audit
- command: yarn audit
+ command: yarn audit --groups dependencies
test-unit:
executor: node
diff --git a/examples/index.html b/examples/index.html
index 5c96d83..282dd82 100644
--- a/examples/index.html
+++ b/examples/index.html
@@ -10,6 +10,7 @@
Basic
Basic Render
Keep alive
+ Usage with multiple apps
Usage with vue-router
Usage with vuex
Usage with vuex + async actions
diff --git a/examples/multiple-apps/app.js b/examples/multiple-apps/app.js
new file mode 100644
index 0000000..ed50e8d
--- /dev/null
+++ b/examples/multiple-apps/app.js
@@ -0,0 +1,82 @@
+import Vue from 'vue'
+import VueMeta from 'vue-meta'
+
+Vue.use(VueMeta)
+
+// index.html contains a manual SSR render
+
+const app1 = new Vue({
+ metaInfo() {
+ return {
+ title: 'App 1 title',
+ bodyAttrs: {
+ class: 'app-1'
+ },
+ meta: [
+ { name: 'description', content: 'Hello from app 1', vmid: 'test' },
+ { name: 'og:description', content: this.ogContent }
+ ],
+ script: [
+ { innerHTML: 'var appId=1.1', body: true },
+ { innerHTML: 'var appId=1.2', vmid: 'app-id-body' },
+ ]
+ }
+ },
+ data() {
+ return {
+ ogContent: 'Hello from ssr app'
+ }
+ },
+ template: `
+ App 1
+ `
+})
+
+const app2 = new Vue({
+ metaInfo: () => ({
+ title: 'App 2 title',
+ bodyAttrs: {
+ class: 'app-2'
+ },
+ meta: [
+ { name: 'description', content: 'Hello from app 2', vmid: 'test' },
+ { 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 },
+ ]
+ }),
+ template: `
+ App 2
+ `
+}).$mount('#app2')
+
+app1.$mount('#app1')
+
+const app3 = new Vue({
+ template: `
+ App 3 (empty metaInfo)
+ `
+}).$mount('#app3')
+
+
+setTimeout(() => {
+ console.log('trigger app 1')
+ app1.$data.ogContent = 'Hello from app 1'
+}, 2500)
+
+setTimeout(() => {
+ console.log('trigger app 2')
+ app2.$meta().refresh()
+}, 5000)
+
+setTimeout(() => {
+ console.log('trigger app 3')
+ app3.$meta().refresh()
+}, 7500)
+setTimeout(() => {
+ console.log('trigger app 4')
+ const App = Vue.extend({ template: `app 4
` })
+ const app4 = new App().$mount()
+}, 10000)
diff --git a/examples/multiple-apps/index.html b/examples/multiple-apps/index.html
new file mode 100644
index 0000000..9fcc869
--- /dev/null
+++ b/examples/multiple-apps/index.html
@@ -0,0 +1,17 @@
+
+
+
+App 1 title
+
+
+
+← Examples index
+App 1
+
+
+
+
+
+
+
+