报错 Custom elements in iteration require ‘v-bind:key‘ directives.“

报错 Custom elements in iteration require ‘v-bind:key’ directives.

  • When using the vue-cli tool for development, the following error occurs when using v-for:
    insert image description here
  • Reason for error: Vue stipulates to use v-for conditional rendering, a key must be set,
  • Solution:
    1.1 Add key
<el-table-column v-for="(val, key) in tableLabel" :key="key" :prop="key" :label="val"/>

Guess you like

Origin blog.csdn.net/qq_50630857/article/details/132246743