0👍
Docs says :
Since in Vue 3, the setup method doesn’t have access to this.$gtag but you can import the method you need like this
import { event } from 'vue-gtag'
export default {
name: 'MyComponent',
setup() {
const login = () => {
event('login', { method: 'Google' })
}
return {
login
}
}
}
Source:stackexchange.com