turbolinks no load component vue











up vote
0
down vote

favorite












Hi I use turbolinks 5 and vue js with webpacker
When I go to link turbolinks load only some content of my components , but other not work . This happens when I go back and go to link again.



Any help.



This is my code of my vue js



import Vue from 'vue/dist/vue.esm';
import SilabusApp from 'components/silabus/app';
import VeeValidate from 'vee-validate';
import BootstrapVue from 'bootstrap-vue';
import 'bootstrap-vue/dist/bootstrap-vue.css';

import Autocomplete from 'v-autocomplete'
// You need a specific loader for CSS files like https://github.com/webpack/css-loader
import 'v-autocomplete/dist/v-autocomplete.css'

import TurbolinksAdapter from 'vue-turbolinks';

// Configuracion de validaciones en español
const VueValidationEs = require('vee-validate/dist/locale/es');
Vue.use(VeeValidate,{
locale: 'es',
dictionary: {
es: VueValidationEs
}
});

Vue.use(Autocomplete);
Vue.use(BootstrapVue);
Vue.use(TurbolinksAdapter);

document.addEventListener('turbolinks:load', () => {

var element= document.getElementById("silabus-app-view");
if (element!=null) {
var vueapp = new Vue({ el: element,
components: { 'silabus-app-view': SilabusApp} });
}
});


And in my html.erb



<div id="silabus-app-view">

<silabus-app-view
:read_only_silabus = false
id_syllabus_program="<%= params[:id] %>"
ref="first"
url_to_be_approve="<%= send_to_approve_syllabus_path(params[:id]) %>"
state_syllabus="<%= @syllabus_program.state %>" >
</silabus-app-view>

</div>

<%= stylesheet_pack_tag 'silabus/app' %>
<%= javascript_pack_tag 'silabus/app' %>


If I disable link turbolinks this components load correclty but this refresh all page.










share|improve this question


























    up vote
    0
    down vote

    favorite












    Hi I use turbolinks 5 and vue js with webpacker
    When I go to link turbolinks load only some content of my components , but other not work . This happens when I go back and go to link again.



    Any help.



    This is my code of my vue js



    import Vue from 'vue/dist/vue.esm';
    import SilabusApp from 'components/silabus/app';
    import VeeValidate from 'vee-validate';
    import BootstrapVue from 'bootstrap-vue';
    import 'bootstrap-vue/dist/bootstrap-vue.css';

    import Autocomplete from 'v-autocomplete'
    // You need a specific loader for CSS files like https://github.com/webpack/css-loader
    import 'v-autocomplete/dist/v-autocomplete.css'

    import TurbolinksAdapter from 'vue-turbolinks';

    // Configuracion de validaciones en español
    const VueValidationEs = require('vee-validate/dist/locale/es');
    Vue.use(VeeValidate,{
    locale: 'es',
    dictionary: {
    es: VueValidationEs
    }
    });

    Vue.use(Autocomplete);
    Vue.use(BootstrapVue);
    Vue.use(TurbolinksAdapter);

    document.addEventListener('turbolinks:load', () => {

    var element= document.getElementById("silabus-app-view");
    if (element!=null) {
    var vueapp = new Vue({ el: element,
    components: { 'silabus-app-view': SilabusApp} });
    }
    });


    And in my html.erb



    <div id="silabus-app-view">

    <silabus-app-view
    :read_only_silabus = false
    id_syllabus_program="<%= params[:id] %>"
    ref="first"
    url_to_be_approve="<%= send_to_approve_syllabus_path(params[:id]) %>"
    state_syllabus="<%= @syllabus_program.state %>" >
    </silabus-app-view>

    </div>

    <%= stylesheet_pack_tag 'silabus/app' %>
    <%= javascript_pack_tag 'silabus/app' %>


    If I disable link turbolinks this components load correclty but this refresh all page.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Hi I use turbolinks 5 and vue js with webpacker
      When I go to link turbolinks load only some content of my components , but other not work . This happens when I go back and go to link again.



      Any help.



      This is my code of my vue js



      import Vue from 'vue/dist/vue.esm';
      import SilabusApp from 'components/silabus/app';
      import VeeValidate from 'vee-validate';
      import BootstrapVue from 'bootstrap-vue';
      import 'bootstrap-vue/dist/bootstrap-vue.css';

      import Autocomplete from 'v-autocomplete'
      // You need a specific loader for CSS files like https://github.com/webpack/css-loader
      import 'v-autocomplete/dist/v-autocomplete.css'

      import TurbolinksAdapter from 'vue-turbolinks';

      // Configuracion de validaciones en español
      const VueValidationEs = require('vee-validate/dist/locale/es');
      Vue.use(VeeValidate,{
      locale: 'es',
      dictionary: {
      es: VueValidationEs
      }
      });

      Vue.use(Autocomplete);
      Vue.use(BootstrapVue);
      Vue.use(TurbolinksAdapter);

      document.addEventListener('turbolinks:load', () => {

      var element= document.getElementById("silabus-app-view");
      if (element!=null) {
      var vueapp = new Vue({ el: element,
      components: { 'silabus-app-view': SilabusApp} });
      }
      });


      And in my html.erb



      <div id="silabus-app-view">

      <silabus-app-view
      :read_only_silabus = false
      id_syllabus_program="<%= params[:id] %>"
      ref="first"
      url_to_be_approve="<%= send_to_approve_syllabus_path(params[:id]) %>"
      state_syllabus="<%= @syllabus_program.state %>" >
      </silabus-app-view>

      </div>

      <%= stylesheet_pack_tag 'silabus/app' %>
      <%= javascript_pack_tag 'silabus/app' %>


      If I disable link turbolinks this components load correclty but this refresh all page.










      share|improve this question













      Hi I use turbolinks 5 and vue js with webpacker
      When I go to link turbolinks load only some content of my components , but other not work . This happens when I go back and go to link again.



      Any help.



      This is my code of my vue js



      import Vue from 'vue/dist/vue.esm';
      import SilabusApp from 'components/silabus/app';
      import VeeValidate from 'vee-validate';
      import BootstrapVue from 'bootstrap-vue';
      import 'bootstrap-vue/dist/bootstrap-vue.css';

      import Autocomplete from 'v-autocomplete'
      // You need a specific loader for CSS files like https://github.com/webpack/css-loader
      import 'v-autocomplete/dist/v-autocomplete.css'

      import TurbolinksAdapter from 'vue-turbolinks';

      // Configuracion de validaciones en español
      const VueValidationEs = require('vee-validate/dist/locale/es');
      Vue.use(VeeValidate,{
      locale: 'es',
      dictionary: {
      es: VueValidationEs
      }
      });

      Vue.use(Autocomplete);
      Vue.use(BootstrapVue);
      Vue.use(TurbolinksAdapter);

      document.addEventListener('turbolinks:load', () => {

      var element= document.getElementById("silabus-app-view");
      if (element!=null) {
      var vueapp = new Vue({ el: element,
      components: { 'silabus-app-view': SilabusApp} });
      }
      });


      And in my html.erb



      <div id="silabus-app-view">

      <silabus-app-view
      :read_only_silabus = false
      id_syllabus_program="<%= params[:id] %>"
      ref="first"
      url_to_be_approve="<%= send_to_approve_syllabus_path(params[:id]) %>"
      state_syllabus="<%= @syllabus_program.state %>" >
      </silabus-app-view>

      </div>

      <%= stylesheet_pack_tag 'silabus/app' %>
      <%= javascript_pack_tag 'silabus/app' %>


      If I disable link turbolinks this components load correclty but this refresh all page.







      javascript vue.js turbolinks turbolinks-5






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 at 5:21









      HalleyRios

      367




      367





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274302%2fturbolinks-no-load-component-vue%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274302%2fturbolinks-no-load-component-vue%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

          ComboBox Display Member on multiple fields

          Is it possible to collect Nectar points via Trainline?