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

Vue 3 Compatibility #166

Open
lsnow99 opened this issue Feb 4, 2021 · 29 comments
Open

Vue 3 Compatibility #166

lsnow99 opened this issue Feb 4, 2021 · 29 comments

Comments

@lsnow99
Copy link

lsnow99 commented Feb 4, 2021

Hi!

What is the current status on Vue 3 compatibility? I'd be happy to test out a branch if there is one in development.

Thanks

@florianrubel
Copy link

Upvote. We need it. :) Please Please Please

@mmorainville
Copy link
Member

mmorainville commented Feb 12, 2021

Hi,

We're working on it but it's not there yet. The difficulty is not the migration/rewrite, it's to find free time to do it ! But it's on its way!
We plan a release as soon as possible but this won't be before at least 2-3 weeks.
if you really need a Vue 3 version right now, you can either: copy/paste the 2 components VueTour and VueStep and test if it's working ok as pretty much all the code should be retro-compatible or you can fork the Vue 2 version and make your own to use until we release the new version.

We understand it's not ideal but it's the best we can do right now.

@sbathgate
Copy link

sbathgate commented Apr 10, 2021

I was toying around with this recently and resolved the incompatibility by running the plugin within my app and updating main.js to:

import VTour from './components/VTour'
import VStep from './components/VStep'

const VueTour = {
  install (app, options) {
    if (!options) {
      options = {};
    }

    app.component(VTour.name, VTour)
    app.component(VStep.name, VStep)

    // Object containing Tour objects (see VTour.vue) where the tour name is used as key
    app.config.globalProperties.$tours = {}
  }
}

export default VueTour;

When I get a couple of minutes I can look at putting together a PR for you, in the meantime hopefully this helps.

Edit:

There were also a couple of deprecated commands to update too.
Destroy -> unmounted,
beforeDestroy -> beforeUnmount

@mmorainville
Copy link
Member

Hi @sbathgate,

Yes sure a PR would be welcome!
If these are really all the changes needed to make the lib Vue 3-compatible it may even be made retro-compatible so that the lib may be compatible with Vue 2 and Vue 3 without breaking changes. This would be great if that's the case!

@Sitronik
Copy link

Hello guys. I added vue 3 support and other functionality PR

@Sitronik
Copy link

Sitronik commented Apr 17, 2021

You will need to create the next branch and move the PR there, then you can publish with the tag next to npm. PR only works for vue3
For those who need to use vue-tour in vue 3 I made a temporary package npm -i v3-tour

@lokize
Copy link

lokize commented Apr 27, 2021

@Sitronik hi, how to use your package after install? i have problems to useit... thanks!

@Sitronik
Copy link

Sitronik commented Apr 27, 2021

@Sitronik hi, how to use your package after install? i have problems to useit... thanks!

Hi, you can download code of package here:
https://github.com/Sitronik/v3-tour
Then run the serve script and you will see that everything works

Example how to use in directory public -> index.html

OR

In you client entry point:

import * as Vue from 'vue'
import App from './App.vue'
import VueTour from 'v3-tour'

require('v3-tour/dist/vue-tour.css')

const app = Vue.createApp(App)

app.use(VueTour)

@DjilanoS
Copy link

DjilanoS commented Jul 1, 2021

Doesn't seem to work for me @Sitronik with Vue3.

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

Doesn't seem to work for me @Sitronik with Vue3.

Hello, show an example of the code you are using

@DjilanoS
Copy link

DjilanoS commented Jul 1, 2021

Trying to get it working with the Vue 3 Composition api, doesn't seem to work.

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import i18n from './locales'
import VueTour from 'v3-tour'


require('v3-tour/dist/vue-tour.css')

const app = createApp(App)
app.use(router).use(i18n).use(VueTelInput, globalOptions).use(VueTour).mount('#app')

Component:

<template>
<h1 data-v-step="0">Hello 👋</h1>
<v-tour name="myTour" :steps="steps"></v-tour>
</template>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '[data-v-step="0"]', // We're using document.querySelector() under the hood
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

Also tried with the old Option api as described in the documentation.

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

Trying to get it working with the Vue 3 Composition api, doesn't seem to work.

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import i18n from './locales'
import VueTour from 'v3-tour'


require('v3-tour/dist/vue-tour.css')

const app = createApp(App)
app.use(router).use(i18n).use(VueTelInput, globalOptions).use(VueTour).mount('#app')

Component:

<template>
<h1 data-v-step="0">Hello 👋</h1>
<v-tour name="myTour" :steps="steps"></v-tour>
</template>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '[data-v-step="0"]', // We're using document.querySelector() under the hood
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

Also tried with the old Option api as described in the documentation.

Try changing target to id of html element should work

<h1 id="step1">Hello 👋</h1>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '#step1',
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

I not tested with "document.querySelector() under the hood"

@DjilanoS
Copy link

DjilanoS commented Jul 1, 2021

Trying to get it working with the Vue 3 Composition api, doesn't seem to work.

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import i18n from './locales'
import VueTour from 'v3-tour'


require('v3-tour/dist/vue-tour.css')

const app = createApp(App)
app.use(router).use(i18n).use(VueTelInput, globalOptions).use(VueTour).mount('#app')

Component:

<template>
<h1 data-v-step="0">Hello 👋</h1>
<v-tour name="myTour" :steps="steps"></v-tour>
</template>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '[data-v-step="0"]', // We're using document.querySelector() under the hood
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

Also tried with the old Option api as described in the documentation.

Try changing target to id of html element should work

<h1 id="step1">Hello 👋</h1>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '#step1',
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

I not tested with "document.querySelector() under the hood"

Thanks for the reply! But changing the target to #step1 doesn't seem to work. No errors are thrown, nor is it showing the tooltips.

@DjilanoS
Copy link

DjilanoS commented Jul 1, 2021

This is the rendered html output:

<div class="v-tour" data-v-22ba47ca>
    <!---->
</div>

<h1 id="step1" data-v-22ba47ca>Hello 👋</h1>

I think it's not working because this.$tours['myTour'].start() is missing. but this. is not accessible within the setup() composition api.

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

Trying to get it working with the Vue 3 Composition api, doesn't seem to work.

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import i18n from './locales'
import VueTour from 'v3-tour'


require('v3-tour/dist/vue-tour.css')

const app = createApp(App)
app.use(router).use(i18n).use(VueTelInput, globalOptions).use(VueTour).mount('#app')

Component:

<template>
<h1 data-v-step="0">Hello 👋</h1>
<v-tour name="myTour" :steps="steps"></v-tour>
</template>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '[data-v-step="0"]', // We're using document.querySelector() under the hood
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

Also tried with the old Option api as described in the documentation.

Try changing target to id of html element should work

<h1 id="step1">Hello 👋</h1>
export default {
    setup: () => {
        const state = reactive({
            steps: [
                {
                    target: '#step1',
                    header: {
                        title: 'Get Started',
                    },
                    content: 'Discover <strong>Vue Tour</strong>!',
                },
            ],
        })

        return {
            ...toRefs(state),
        }
    },
}

I not tested with "document.querySelector() under the hood"

Thanks for the reply! But changing the target to #step1 doesn't seem to work. No errors are thrown, nor is it showing the tooltips.

You are welcome. You need to add v-step component in html template as in example:
https://github.com/Sitronik/v3-tour/blob/master/public/index.html

Download code of https://github.com/Sitronik/v3-tour and run "serve" script and you will see everything works correctly in example

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

This is the rendered html output:

<div class="v-tour" data-v-22ba47ca>
    <!---->
</div>

<h1 id="step1" data-v-22ba47ca>Hello 👋</h1>

I think it's not working because this.$tours['myTour'].start() is missing. but this. is not accessible within the setup() composition api.

Maybe I tested with old options api

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

PRs are welcome)

@DjilanoS
Copy link

DjilanoS commented Jul 1, 2021

Ah yeah, you are using the old Options api, most packages that are updated for Vue 3 are compatible with the new Composition api. That's would be the confusion here.

Thanks!

@Sitronik
Copy link

Sitronik commented Jul 1, 2021

Ah yeah, you are using the old Options api, most packages that are updated for Vue 3 are compatible with the new Composition api. That's would be the confusion here.

Thanks!

You are welcome. I needed to quickly make support for vue 3 and I did not focus on the composition api, so you can send your PR with support)

@devheniik
Copy link

image
Realy??

I am tried all ways don't working

@Sitronik
Copy link

Sitronik commented Aug 5, 2021

image
Realy??

I am tried all ways don't working

I corrected the ways to v3-tour in readme, try

@devheniik
Copy link

devheniik commented Aug 5, 2021

I corrected the ways to v3-tour in readme, try

All work!!

@adarshmadrecha
Copy link

Found this which is fork with vue 3 support https://github.com/alexandreDavid/vue3-tour

@Bodrosh
Copy link

Bodrosh commented Mar 10, 2022

This is the rendered html output:

<div class="v-tour" data-v-22ba47ca>
    <!---->
</div>

<h1 id="step1" data-v-22ba47ca>Hello 👋</h1>

I think it's not working because this.$tours['myTour'].start() is missing. but this. is not accessible within the setup() composition api.

Maybe I tested with old options api

Hello, I found a way to work with composition API:
import { onMounted } from 'vue'

 onMounted(() => {
           const internalInstance = getCurrentInstance()
           const $tours = internalInstance.appContext.config.globalProperties.$tours
           if ($tours) {
               if ($tours['myTour']) {
                   $tours['myTour'].start()
               }
           }
       })

@didaquis
Copy link

Hi! Still no Vue 3 support for this library?

@lokize
Copy link

lokize commented Nov 5, 2022

+1 for vue 3 support

@roger-hermasch
Copy link

Any update here?

@TheAustinG
Copy link

Any update here?

I believe this project is dead but someone did fork it and make it compatible with Vue 3. I have been using it without any issues so far.
https://github.com/alexandreDavid/vue3-tour

@vollyimnetz
Copy link

Ok, i tested vue3-tour and v3-tour after we used vue-tour for 2 years (hope to get an update).

vue3-tour has many changes and did not provide the same functions or even all the callbacks.
v3-tour worked out of the box as vue-tour before. The only thing that i have to face is that the background overlay is on the correct z-index. But that has likely to do with our update from vuetify2 to vuetify3.

So i would recommend v3-tour. https://github.com/Sitronik/v3-tour

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