moritzsternemann / vue-plausible

Plausible Analytics Vue.js Plugin and NuxtJS Module
MIT License
120 stars 8 forks source link

Vue 3 Support #17

Open YanDevDe opened 2 years ago

YanDevDe commented 2 years ago

In order to use Vue 3 Plugins, you need to import Vue3Plausible instead of VuePlausible

import { createApp, reactive } from 'vue'
import {Vue3Plausible} from "vue-plausible

const app = createApp(App)
app.use(Vue3Plausible, {
    domain: "<domain>"
    //..other configurations
});";

The typing may need some working as well. Temporarly I used //@ts-ignore here since most of the typings is still using Vue 2 instead from Vue 3. Any Pull Request at my side is welcome.

This is just a quick solution for people who need Vue 3 support right now.

YanDevDe commented 2 years ago

Also I removed lib in .gitignore - so then it can be directly used per npm i https://github.com/YanDevDe/vue-plausible for temporary solution.