Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nuxt 3 #265

Open
VenkateshDotdash opened this issue Apr 8, 2024 · 0 comments
Open

Support for nuxt 3 #265

VenkateshDotdash opened this issue Apr 8, 2024 · 0 comments

Comments

@VenkateshDotdash
Copy link

VenkateshDotdash commented Apr 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant