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.
|
First install the plugin you want.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn add --dev vue-gtag
|
yarn add --dev vue-gtag-next
|
||||||
```
|
```
|
||||||
|
|
||||||
Then create a plugin file `plugins/vue-gtag.client.js`.
|
Then create a plugin file `plugins/vue-gtag.client.js`.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { defineNuxtPlugin } from "#app";
|
import { defineNuxtPlugin } from "#app";
|
||||||
import VueGtag from "vue-gtag";
|
import VueGtag from "vue-gtag-next";
|
||||||
|
|
||||||
export default defineNuxtPlugin((nuxtApp) => {
|
export default defineNuxtPlugin((nuxtApp) => {
|
||||||
nuxtApp.vueApp.use(VueGtag, {
|
nuxtApp.vue.use(VueGtag, {
|
||||||
config: {
|
property: {
|
||||||
id: "GA_MEASUREMENT_ID",
|
id: "GA_MEASUREMENT_ID"
|
||||||
params: {
|
}
|
||||||
anonymize_ip: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user