Home > Web Front-end > JS Tutorial > body text

Detailed explanation of the use of v-for iteration syntax in Vue2.0

php中世界最好的语言
Release: 2018-03-28 10:33:20
Original
1808 people have browsed it

This time I will bring you a detailed explanation of the use of v-for iteration syntax in Vue2.0. What are the precautions for using v-for iteration syntax in Vue2.0. The following is a practical case, let’s take a look. take a look.

Today, when writing code about Vue2.0, I found that the value of $key cannot be rendered successfully. The problem is as follows:

The result is this The key value of object cannot be displayed:

#I later found out after consulting the documentation that this is because in Vue2.0, the v-for iteration syntax has already occurred Changed:

Discarded:

##New array Syntax

value in arr 
(value, index) in arr
Copy after login

New object syntax

value in obj (value, key) in obj 
(value, key, index) in obj
Copy after login

After solving:

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website !

Recommended reading:

The use of v-for index index in html

What are the packaging paths for vue+webpack question

The above is the detailed content of Detailed explanation of the use of v-for iteration syntax in Vue2.0. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template