Answer the question
In order to leave comments, you need to log in
How to access the data of the component in which it is used from a custom directive in vue.js?
It is necessary to get access from the custom directive to the name of the component - $options.name. Passing this value to each time the directive is called is not an option, since the purpose of the directive is to shorten certain logic.
Answer the question
In order to leave comments, you need to log in
Directives do not know how to work with components, because they know nothing about them and should not know. They were invented for something else, namely
to perform low-level operations on the DOMquote from the docs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question