Vue2.xx prompts [vue warn]: Error in render: "typeerror: cannot read property 'img 'of undefined"

Source: Internet
Author: User

Item is a piece of data requested from the background, which contains IMG, but prompts that IMG is not defined

Code of the Child component when the parent component transmits data to the child component:


Tip:

Cause: it may be that the page rendering and request data are asynchronous operations, the data has not been requested to end, the page has started rendering, so at the beginning of reporting undefined variables, after the data acquisition is complete, rendering again, the page content is displayed, but the warning at the beginning is also displayed.

Solution:

1.

2. Before using item, V-If = "item"

Vue2.xx prompts [vue warn]: Error in render: "typeerror: cannot read property 'img 'of undefined"

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.