A
A
Alexander2021-12-01 18:15:43
Vue.js
Alexander, 2021-12-01 18:15:43

Is it possible to proxy a Vue directive?

I searched and understand that most likely not, but maybe I'm just not looking for something.
There is a project. There are many components in the project where the built-in Vue directive is used.
Can I proxy it so I can change the input before it gets to the directive?

Type for something like<p v-show="payload">...</p>

Vue.directives['v-show'].proxy = (payload) => {
  return true;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lillipup, 2021-12-01
@Aleksandr-JS-Developer

You can probably create your own directive that will do the same thing as v-show, but before changing the output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question