vue-tour icon indicating copy to clipboard operation
vue-tour copied to clipboard

Support for nuxt 3

Open VenkateshDotdash opened this issue 1 year ago • 0 comments

Migrating the project from nuxt 2 to nuxt 3 I am currently using the vue-tour plugin to render tour in my nuxt 2 application. Able to start the tour using this.$tours["myTour"].start() in mounted function.

** plugins folder nuxt 2** import Vue from 'vue'; import VueTour from 'vue-tour';

require('vue-tour/dist/vue-tour.css'); Vue.use(VueTour);

I am migrating the code base to nuxt 3. Used the same code in nuxt 3 under plugins folder. But this.$tours shows undefined. Even window.$tours throws error. Tried printing the variable this but it throws undefined.

image Trial and error

Even tried registering the plugin as client only. But it doesn't work.

Also modified the last line of Vue.use to

export default defineNuxtPlugin(nuxtApp => { nuxtApp.vueApp.use(Vue3Tour); })

But this fails as well.

Does this plugin support nuxt 3 and if so any idea on how to start the tour after registration ?

Reference Used this codesand box in vue 3 for reference https://codesandbox.io/p/sandbox/vue3-tour-bszr2?file=%2Fsrc%2FApp.vue

VenkateshDotdash avatar Apr 08 '24 19:04 VenkateshDotdash