Automatic display error-message
if exists
#11771
Replies: 5 comments 3 replies
-
Because that would mean extra work - you would update a full message instead of a boolean. |
Beta Was this translation helpful? Give feedback.
-
@pdanpdan I don't get your point or maybe you misunderstood the use case. We get the errors from the backend. Thus there is no single error message but there may be many different ones. Thus we can't simply toggle the Suggestion: Maybe |
Beta Was this translation helpful? Give feedback.
-
I am just guessing here but the element might be "errored" without a message. Hence two separate properties. |
Beta Was this translation helpful? Give feedback.
-
My point is: My suggestion was to add something like this that makes this use case as short as possible overall:
We priorly used Vuetify and there the approach just using |
Beta Was this translation helpful? Give feedback.
-
Your "error" is that you are looking at the message as the primary logic whereas it is actually the error boolean that drives the main logic. The error message is only secondary functionality. Imagine using notify plugin to display error messages instead of printing them into the field where the developer would use only the boolean. The message itself is irrelevant without the boolean driving the entire thing. Adding another layer of complexity makes no sense. If you really think this is a big deal then you can simply wrap the input into your own component and simply trigger error whenever there is error message, otherwise all attributes will be inherited. |
Beta Was this translation helpful? Give feedback.
-
Hi!
Currently for displaying error messages you need to explicitly also to set
:error="..."
Why not simply display error message detecting the presence of
:error-message="..."
? If its not empty just show it, otherwise don't.Beta Was this translation helpful? Give feedback.
All reactions