Static GitHub Issues

[898] ssr custom directive

prev: nuxt 1.x version not working performance: { prefetch: false }
next: Including fonts in styles

Hello my custom directive not working on server side!

directive

Vue.directive('mydirective', {
  bind (el, binding) {
    el.innerHTML = 'mydirective worked';
  }
});

html template <div v-mydirective="{foo: 'bar'}">initial text</div>

This code worked only browser - not working on server side (( How fix this problem??

Thanks, really very need this.

PS. How worked directive

v-html

This worked on server side and client side.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c768">#c768</a>)</em></sub></div>