[Conventional] differences between Attr and Prop

Source: Internet
Author: User

[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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.