1. 程式人生 > >vue 報錯解決:component lists rendered with v-for should have explicit keys.

vue 報錯解決:component lists rendered with v-for should have explicit keys.

使用iview時控制檯遇到的告警資訊:
: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.
@ ./src/components/VideoManage/StickersNew.vue 7:0-374
原本的程式碼如下:

  <Col span="2">
  <Select placeholder="請選擇國家" v-model="area">
    <Option v-for="(area, key) in areaCountry" :value="key">{{ area.desc }}</Option>
  </Select>
  </Col>

執行時顯示warning,新增:key即可,如下

  <Col span="2">
  <Select placeholder="請選擇國家" v-model="area">
    <Option v-for="(area, key) in areaCountry" :value="key" :key="area.desc">{{ area.desc }}</Option>
  </Select>
  </Col>

相關推薦

vue 解決component lists rendered with v-for should have explicit keys.

使用iview時控制檯遇到的告警資訊: : component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for

vue警告component lists rendered with v-for should have explicit keys

./~/vue-loader/lib/template-compiler?{"id":"data-v-6f0bc418"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/views/index/

component lists rendered with v-for should have explicit keys

end sts 原因 錯誤 簡單 img 出現 span 渲染 出現這個報錯的主要原因是 component lists rendered with v-for should have explicit keys 去官網看了下v-for,簡單說就是有相同父元素的子元素要

vue 解決TypeError: Cannot read property '_t' of undefined"

前端報錯如下: [Vue warn]: Error in render: “TypeError: Cannot read property ‘_t’ of undefined” 是在專案中用了多語言配置,vue 跟 i18n之間的相容問題。解決方法如下:

用electron打包vue專案中的解決

(原創,轉載請註明出處!) 這裡,也要提到實際專案中的問題,可能有同志的目錄結構和內容有些許差別,就我剛剛遇到的問題來說,常見的問題的有幾個問題,以及解決辦法如下: 1.  首先,一定要cd到專案的根目錄(我這裡是app)裡面才能執行專案,再重新npm run bui

vue3 解決找不到模組‘xxx.vue’或其相應的型別宣告。(Vue 3 can not find module)

最近在用 vue3 寫一個小元件庫,在 ts 檔案中引入 .vue 檔案時出現以下報錯:      報錯原因:typescript 只能理解 .ts 檔案,無法理解 .vue檔案 解決方法:在專案根目錄或 src 資料夾下建立一個字尾為 .d.ts 的檔案,並寫入以下內容:

zabbix服務器環境--安裝過程中的解決【Error: Package】

解決 could gen 分析 finish cli agent base 通過 # 錯誤提示: --> Finished Dependency Resolution Error: Package: php-ldap-5.4.16-42.el7.x86_64 (bas

java呼叫郵箱解決Client was not authenticated to send anonymous mail during MAIL FROM

郵件傳送報錯資訊 com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM 錯誤資訊:

hibernate解決Unable to instantiate default tuplizer

java 專案啟動報錯 Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Pycharm解決error:please select a valid Python interpreter

問題描述: 之前PC上安裝的是Python2,後來工作需要轉成Python3了。然後在用pycharm執行Python2的程式時發現源程式執行報錯(出去語法錯誤) error:please select a valid Python interpreter 問題原因: 在pycharm匯入源專案的

MySQL主從解決Table ‘mysql.gtid_slave_pos’ doesn’t exist

給內部一個數據庫做異地熱備,熱備部分採用了 MariaDB 的 galera 叢集模式。然後挑選其中一臺作為 Slave 和深圳主叢集做主從同步。 主叢集是老環境,用的版本還是是 MySQL 5.5.13。用常規辦法建立主從同步 MariaDB [(none)]

svn解決Previous operation has not finished; run 'cleanup' if it was interrupted

背景,在更新專案的時候,更新一半突然出現了error,隨後重新更新,結果出現了下面的錯誤 專案上的svn圖示也不見了。 試了刪專案也沒用,在任何一級目錄操作均報此問題; 上網查瞭解決辦法,挺複雜,確沒效果,比如在專案.svn目錄下各種操作,都沒起作用,結果,專案上點

YUM解決rpmdb open failed

repo onf main failed emp The ultra edi ril yum安裝某個軟件的時候,出現報錯 [root@aws ~]# yum install -y zabbix-agent rpmdb: unable to join the environm

升級jdk8後系統解決java.lang.RuntimeException: java.io.IOException: invalid constant type: 18

今天專案從jdk7升級到jdk8,Tomcat啟動竟然報出這個執行時錯誤。 錯誤資訊:java.io.IOException: invalid constant type: 18 2015-09-17 09:06:16:ERROR localhost-startStop-1 org.s

https請求解決javax.net.ssl.SSLException: Not trusted ...

通過https協議請求資料報錯了一下錯誤:javax.net.ssl.SSLException: Not trusted server certificate exception.在國外論壇上找了個解決的方案和大家分享。      我們需要自定義一個繼承org.apache.http.conn.ssl.SS

postgresql叢集解決SELECT pg_catalog.pg_try_advisory_xact_lock_shared(65535, 65535)

10月25號之後只能對evap資料庫進行select操作,且執行報錯如下: org.postgresql.util.PSQLException: ERROR: pooler: failed to create connections in parallel mode for thread

maven專案新增Gson的依賴後無法啟動,BeanCreationExceptionError creating bean with name 'gsonBuilder'

具體錯誤如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gsonBuilder' defined in class path

vueComponent template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

顯示 sin ont img root png ima pan 如果 在.vue文件中引入了 element-ui 的 table 和 pagination 組件後,報錯:Component template should contain exactly one root

VueUncaught TypeError: Cannot assign to read only property’exports‘ of object’#[Object]‘的解決方法

發現問題 1,執行一下以前的一個Vue+webpack的 vue仿新聞網站  小專案,報錯 由於自己vue學習不深入,老是這個報錯,找了好久(確切的說是整整一下午^...^)才找到原因 -v- 2,點開錯誤的檔案,標註錯誤的地方是這樣的一段程式碼: 就是&n

VueUncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解決方法

oid 方法 ids mlu efault 允許 mod gii ack 因為webpack 2中不允許混用import和module.exports , 解決辦法就是統一改成ES6的方式編寫即可. import { copyDeep } from ‘@/lib