[Vuejs]-How to disable v-if compilation caching when condition is truthy again?

0👍

Why don’t you just create a preview component with a template and add the content there.

HTML

  <preview v-if="displayme">{{{content}}}</preview>
  <template id="preview">
    <div>
      <slot></slot>
    </div>
  </template>

If that isn’t possible because of components. Here is an extended discussion on the compile function https://github.com/vuejs/Discussion/issues/254.

But notice this comment where it is suggested that you use repeats to create new components on the fly. See if you can use v-for to create the list of components and this will get you around the HTML compilation issue.

Leave a comment