// Generated by Vuejs gem ~> github.com/ytbryan/vuejs // Run this example by adding <%%= javascript_pack_tag "<%= name %>" %> into your // Rails' view // To generate another component part with turbolinks, please run `rails generate vue something --turbolinks` import TurbolinksAdapter from 'vue-turbolinks'; import Vue from 'vue.esm' <% if options['seperate'] -%> import App from '../parts/<%= name %>/<%= name %>.vue' <% else -%> import App from '../parts/<%= name %>.vue' <% end -%> Vue.use(TurbolinksAdapter) document.addEventListener('turbolinks:load', () => { if(isView("###")){ const <%= name %> = new Vue({ render: h => h(App) }).$mount('#<%= name %>') console.log({<%= name %>}) } })