mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
docs: update vue plugin example (#1311)
This commit is contained in:
parent
d1214c9aae
commit
1a41c8819b
@ -51,23 +51,20 @@ If you want to use Vue plugins, like [vue-gtag](https://github.com/MatteoGabriel
|
||||
First install the plugin you want.
|
||||
|
||||
```bash
|
||||
yarn add --dev vue-gtag
|
||||
yarn add --dev vue-gtag-next
|
||||
```
|
||||
|
||||
Then create a plugin file `plugins/vue-gtag.client.js`.
|
||||
|
||||
```ts
|
||||
import { defineNuxtPlugin } from "#app";
|
||||
import VueGtag from "vue-gtag";
|
||||
import VueGtag from "vue-gtag-next";
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.vueApp.use(VueGtag, {
|
||||
config: {
|
||||
id: "GA_MEASUREMENT_ID",
|
||||
params: {
|
||||
anonymize_ip: true,
|
||||
},
|
||||
},
|
||||
nuxtApp.vue.use(VueGtag, {
|
||||
property: {
|
||||
id: "GA_MEASUREMENT_ID"
|
||||
}
|
||||
});
|
||||
});
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user