vuevalid-v-for Custom elements in iteration require v-bind key directives.

 

 

1、錯誤截圖

 

2、解決辦法

將v-for其中加上key值,同時後面應包含 :key="key"

   <el-timeline-item :timestamp="blog.created" placement="top" v-for="(blog,key) in blogs" :key="key">
          <el-card>
            <h4>
              <router-link :to="{name: 'BlogDetail', params: {blogId: blog.id}}">{{blog.title}}</router-link>
            </h4>
            <p>{{blog.description}}</p>
          </el-card>
        </el-timeline-item>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章