[Conventional] differences between Attr and Prop
"Why are you a programmer ?", "Because I have a heart that changes the world !", "Speaking People", "because I have no friends ..."
------------- Purely entertaining
========================================================== ==================================
The tool model written a few days ago has a bug today: the check box is displayed incorrectly, and the selected status in the pop-up box is deleted. When other pop-up boxes are displayed, the selected status is also missing...
After confirming that the data received in the background is normal, the front-end display is faulty ~ It's not hard to figure out, because there was a bug with similar issues, and I checked the cause and solution of the problem.
Cause: the attr setting attribute does not take effect immediately.
Solution: replace attr with prop.
So how should they be used?
To put it simply, the checked, disabled, and selected forms can be expressed using true and false, and the prop is used to display the results immediately after the setting is successful; the rest can use attr.