We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a78c43 commit 6b6809eCopy full SHA for 6b6809e
lib/plugin.js
@@ -1,11 +1,15 @@
1
import Vue from 'vue'
2
import VueAnalytics from 'vue-analytics'
3
4
-export default (ctx, inject) => {
+export default async (ctx, inject) => {
5
const options = <%= serialize(options) %>
6
7
+ if (typeof options.asyncID === 'function') {
8
+ options.id = await options.asyncID(ctx)
9
+ }
10
+
11
Vue.use(VueAnalytics, {...{ router: ctx.app.router }, ...options})
-
12
13
ctx.$ga = Vue.$ga
14
inject('ga', Vue.$ga)
15
}
0 commit comments