The solution to the error that the element form input box keeps reporting that the input is empty

My friend told me that when he wrote a dynamic form component, he kept reporting an error: The input box clearly has a value, and the input box prompts the message that the input is empty

Chestnut:

If your code and error, like the above, you still can not find a half-day problems, please click directly here " .

Code analysis process

View the most direct code

Check the regularity to determine whether there is a problem. If it is a very simple line of code as shown in the figure below, then proceed to the next step of analysis.
Chestnut:

Check whether there is a problem with the dynamic form component (as long as it is prop and rule)

This piece has one : prop is a point that is easier to make mistakes. His last is a string (can be:'obj.value') The specific chestnuts are as follows:
chestnuts

The prop parsed above is input1.value (string) , and the value corresponding to v-model is also input.value (variable) (the value is the same, but prop is a string, and v-model is a variable)

The last one (also the one that didn’t find the problem in one hour)

This is a very simple, others have not seen out of this wrong, I was a mentally handicapped (Ba, Baba Baba, Baba Ba) eleven mentally as my second ha

Here comes the point


The red box here should be : model=“formDataObj.list” , not v-model. (Tell me, copy can be wrong).

If this line just can't solve your problem, then please look at the first two (the first two just keep me from being so mentally retarded.)

In addition, if you want to get my rubbish form component, please leave a message and I will directly package it and send it to your mailbox. The transfer function of the component, I also have various chestnuts.

Ok. At this point, the basic introduction is complete,

Like it, just comment.

Dislike, please explain why.

thank.

Guess you like

Origin blog.csdn.net/DoLi_JIN/article/details/106498514