[Vuejs]-Only load Vue component data once

0👍

Try adding v-once to the accordion:

Cheap Static Components with v-once

Rendering plain HTML elements is very fast in Vue, but sometimes you
might have a component that contains a lot of static content. In
these cases, you can ensure that it’s only evaluated once and then
cached by adding the v-once directive to the root element, like
this:

Vue.component('terms-of-service', {
  template: '\
    <div v-once>\
      <h1>Terms of Service</h1>\
      ... a lot of static content ...\
    </div>\
  '
})

Leave a comment