Replies: 1 comment 1 reply
-
It is understandable to intend to simplify the code and make it more concise, but the suggestion to create a directive like v-if-text or v-if-add may not be a good idea When creating a custom directive to combine two specific functionalities (v-if and v-text), you might be sacrificing the principle of decoupling. Vue is designed with the idea of independent and reusable components. Merging specific functionalities may compromise the ability to reuse these directives in different contexts. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When developing, we often have to check whether an element exists before displaying it.
Example :
It might be interesting to create a directive that combines the v-if and v-text directives.
Solution :
Regarding the name of this directive, I have no firm idea.
Beta Was this translation helpful? Give feedback.
All reactions