Subscribe on changes!

How to handle multiple instructions correctly?

avatar
Oct 3rd 2020

Version

3.0.0

Reproduction link

https://codepen.io/pen/

Steps to reproduce

// test.vue

<template>
  <div>test1</div>
  <div>test2</div>
</template>

App.vue

<template>
  <test v-test></test>
</template>

<script>
import test from "./components/test";
export default {
  components: {
    test,
  },
  directives: {
    test(el) {
      el.setAttribute("data-par", "test");
    },
  },
};
</script>

What is expected?

<template>
  <div data-par="test">test1</div>
  <div data-par="test">test2</div>
</template>

What is actually happening?

Runtime directive used on component with non-element root node. The directives will not function as intended.

avatar
Oct 3rd 2020

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.