// Nuxt 3
export default defineNuxtPlugin(nuxtApp => {
const sayHello = () => {
console.log('Hello');
}
nuxtApp.provide('hello', {
sayHello
});
});
export default ({ app, store }, inject) => {
inject("notifier", {
showMessage({ content = "", color = "" }) {
store.commit("snackbar/showMessage", { content, color });
}
});
};
//For nuxt 3 - create a folder name plugins and create a file like plugins/vue-gtag.client.- nuxt will auto-import :)
import VueGtag from 'vue-gtag-next'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueGtag, {
property: {
id: 'GA_MEASUREMENT_ID'
}
})
})
import VueGtag from 'vue-gtag-next'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueGtag, {
property: {
id: 'GA_MEASUREMENT_ID'
}
})
})