Comments (8)
Hi @fernandofloresg,
To change the language of the buttons you can override the actions
slot of the v-step
component.
The documentation is still a work-in-progress but you can find more information on this page:
https://pulsar.gitbooks.io/vue-tour/customizing-the-template.html
Basically at the moment if you want to customize the template of the steps, you have to iterate over the steps in your v-tour
component. If you use vue-i18n to translate your app, you'll have to do something like this:
<v-tour name="myTour" :steps="steps">
<template slot-scope="tour">
<transition name="fade">
<v-step v-if="tour.currentStep === index" v-for="(step, index) of tour.steps" :key="index" :step="step" :previous-step="tour.previousStep" :next-step="tour.nextStep" :stop="tour.stop" :isFirst="tour.isFirst" :isLast="tour.isLast">
<template>
<div slot="actions">
<button @click="tour.stop" v-if="!tour.isLast" class="v-step__button">{{ $t("skipTour") }}</button>
<button @click="tour.previousStep" v-if="!tour.isFirst" class="v-step__button">{{ $t("previous") }}</button>
<button @click="tour.nextStep" v-if="!tour.isLast" class="v-step__button">{{ $t("next") }}</button>
<button @click="tour.stop" v-if="tour.isLast" class="v-step__button">{{ $t("finish") }}</button>
</div>
</template>
</v-step>
</transition>
</template>
</v-tour>
I know it requires to add a lot of boilerplate if you want to customize your tour, but for now it's the better solution we found to provide a full control over the templates of the steps. We plan to make the customization simpler in later releases, at least for translation purposes.
Hope I've been able to help you!
from vue-tour.
Thanks, keep up the good work ! 👍
from vue-tour.
If you guys change locale in realtime, use computed property for labels.
If using labels in data, it's not responsible in realtime.
from vue-tour.
The code you posted throws a lot of errors in my code like:
TypeError: "_vm.labels is undefined; can't access its "buttonSkip" property"
and
TypeError: "popper is undefined; can't access its "setAttribute" property"
Can you post a minimum example?
from vue-tour.
Hi @nattyluke,
You can check my answer here: #53 (comment)
It's our mistake, we forgot to update this part of the doc for the v1.1.0.
from vue-tour.
See this example to change the button steps description.
from vue-tour.
labels: {
buttonSkip: i18n.tc("SKIP"),
buttonPrevious: i18n.tc("PREVIOUS"),
buttonNext: i18n.tc("NEXT"),
buttonStop: i18n.tc("FINISH"),
},
from vue-tour.
I did as @quroom suggested, and it works!
from vue-tour.
Related Issues (20)
- Get some more contextual data on callbacks
- onFinish callback HOT 6
- Conditionally Stop HOT 1
- finish prop is missing in Customizing the Template inside Documentation
- Build fails in vue-tour (npm run build)
- Tour stops when targets aren't found HOT 2
- Memory leak when using VueTour in vue-test-utils [BUG]
- Vue 3 Compatibility HOT 5
- Is there a way to install locally rather than globally HOT 1
- Unable to point to elements in child components using vue 2 and quasar
- Disable interaction with any elements while tour is displayed HOT 3
- Stop the tour HOT 1
- After adding v-if to the component, the component will not be destroyed if the condition is false. HOT 2
- Install with Nuxt3 HOT 2
- Embed Image in tour HOT 1
- Can I pause a tour? HOT 1
- How to integrate with vite ? HOT 2
- Cross iFrame
- Switching from vue-cli to vite
- the callback which name is onFinish does not trigger HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-tour.