How can i use custom ssr directive on <component> tag in Vue2?

Viewed 19

I write my custom ssr directive in my BundleRenderer options like this:

directives: {
          dataWidgetName(node, binding) {
            if (binding.value) {
              node.data.attrs['data-widget-name2'] = binding.value;
            }
          }
        }

And then I use this directive on my 'component' tag:

<template>
  <component
    :is="errorCheckWidget"
    v-bind="widgetProps"
    v-data-widget-name="widgetProps.componentName"
  />
</template>

But this doesn't work, my directive doesn't even called. The ploblem seems to be because of component tag: if I set my directive on 'div' tag, it will be working... Does anybody know possible solutions to solve this problem?

0 Answers
Related