Error compiling template:

 
  <template v-for="item in quarterList" :key="item.id">
                    <td>{{item.quarterValue}}</td>
  </template>

原因:vue不支持在 template 元素上绑定属性。比如这里想绑定 key 属性就不行。

解决方法:

1.可以改成div或者

2.不使用template元素做for循环 

3.删除key

<template v-for="item in quarterList">
                    <td>{{item.quarterValue}}</td>
 </template>

 


版权声明:本文为lojieo原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。