Skip to content

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

Open
@ankitsinghaniyaz

Description

@ankitsinghaniyaz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions