Skip to main content

13 How to use Vue.js and Turbolinks together

Episode 182 · April 17, 2017

Using Vue.js and Turbolinks together can be a little complex to wrap your head around at first. We not only dive into how this works but we take a look at the vue-turbolinks node module I made so that you can easily use the two together.

Javascript


Resources

To add Vue-Turbolinks into your Rails Webpacker installation, you can do the following:

yarn add vue-turbolinks
import TurbolinksAdapter from 'vue-turbolinks';

document.addEventListener('turbolinks:load', () => {
  var vueapp = new Vue({
    el: "#app",
    template: '<App/>',
    mixins: [TurbolinksAdapter],
    components: { App }
  });
});

No transcripts available. Earn a free month

Discussion