Home  >  Article  >  Web Front-end  >  How to solve vue $index error reporting problem

How to solve vue $index error reporting problem

藏色散人
藏色散人Original
2020-12-25 09:49:282979browse

vue $index reports an error because vue has removed the original usage of $index and $key and changed it to index and key. The solution is to modify $index and $key to index and key.

How to solve vue $index error reporting problem

The operating environment of this tutorial: Windows 7 system, Vue.js v2.5.16 version, Dell G3 computer.

Recommended related articles: vue.js

Vue.js v1.0.21 uses $index and $key in the vue loop array.

Vue of Vue.js v2.5.16 reports the following error when using $index and $key when looping data, looping json object data and arr array.

How to solve vue $index error reporting problem

The result is that vue has removed the original $index and $key usage and changed them to index and key.

You need to pay attention here to the order of value, key, index, which must be in this order.

The code is as follows:

 

json数据类型

  • {{value}} ~ {{key}} ~ {{index}}

arr数组类型

  • {{value}} ~ {{index}}

The above is the detailed content of How to solve vue $index error reporting problem. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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