Giter Site home page Giter Site logo

Comments (9)

tomexx avatar tomexx commented on August 14, 2024

It's probably enough to introduce another check using _current and _history.length properties. I can create a PR later.

from vue-router-back-button.

MaximVanhove avatar MaximVanhove commented on August 14, 2024

The problem is that the package listens on route enter and doesn't know if it went back by a button in the menu, the back button you added or the native back button.

from vue-router-back-button.

tomexx avatar tomexx commented on August 14, 2024

@MaximVanhove Yes... then that's no use in certain scenarios like I have... :/

from vue-router-back-button.

MaximVanhove avatar MaximVanhove commented on August 14, 2024

Could you explain your scenarios? Maybe I can help.

from vue-router-back-button.

tomexx avatar tomexx commented on August 14, 2024

I need to differentiate these two scenarios:

Page A -> navigate to Page B -> navigate to Page A

Page A -> navigate to Page B -> back button (returning to Page A)

from vue-router-back-button.

tomexx avatar tomexx commented on August 14, 2024

Page A -> navigate to Page B -> navigate to Page A

the third step should be stored as a separate item in history array, then it would work as expected with all the methods I think

from vue-router-back-button.

MaximVanhove avatar MaximVanhove commented on August 14, 2024

I think you can use the click event on the button and emit an event. What would you like to do if you click the back button?

from vue-router-back-button.

tomexx avatar tomexx commented on August 14, 2024

Well, that's tricky. I need to watch $route changes and then show or hide some component, depending on if user went back from certain route or came there from another place. Your package would solve this easily without handling events which would add complexity

from vue-router-back-button.

MaximVanhove avatar MaximVanhove commented on August 14, 2024

I guess you could fork my repo and modify it so that it only writes history. Then use the click event on the button to go back to the last.

from vue-router-back-button.

Related Issues (14)

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.