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

Do you suggest a way to use vue with turbolink enabled? #38

Open
ankitsinghaniyaz opened this issue Mar 6, 2017 · 1 comment
Open

Comments

@ankitsinghaniyaz
Copy link

ankitsinghaniyaz commented Mar 6, 2017

Currently I do something like this:

window.addEventListener('turbolinks:load', function () {})

This will trigger the method on every call. This lead me to another problem where I mount a component based on id, so to prevent that I' do this(not sure if it is the best way):

if(!document.getElementById('repositories')) {
    return
}

Edit

react-rails does something similar, they do not require us to remove Turbolink. As far as I understood from here, they seem to be mounting and unmounting the components of turbolink callbacks.

@AxelTheGerman
Copy link

checkout https://github.com/excid3/vue-turbolinks
walk-through and explanation here: https://gorails.com/episodes/how-to-use-vuejs-and-turbolinks-together

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

2 participants