Giter Site home page Giter Site logo

Comments (8)

mmorainville avatar mmorainville commented on August 16, 2024 5

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.

fernandofloresg avatar fernandofloresg commented on August 16, 2024 1

Thanks, keep up the good work ! 👍

from vue-tour.

quroom avatar quroom commented on August 16, 2024 1

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.

nattyluke avatar nattyluke commented on August 16, 2024

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.

mmorainville avatar mmorainville commented on August 16, 2024

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.

JoedsonGabriel avatar JoedsonGabriel commented on August 16, 2024

See this example to change the button steps description.
image

from vue-tour.

deepaksisodiya avatar deepaksisodiya commented on August 16, 2024
labels: {
    buttonSkip: i18n.tc("SKIP"),
    buttonPrevious: i18n.tc("PREVIOUS"),
    buttonNext: i18n.tc("NEXT"),
    buttonStop: i18n.tc("FINISH"),
  },

from vue-tour.

wladston avatar wladston commented on August 16, 2024

I did as @quroom suggested, and it works!

from vue-tour.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.