工作193:vue.runtime.esm.js?2b0e:619 [Vue warn]: <transition-group> children must be keyed: <ElTag>
標題[Vue warn]: children must be keyed:
今天學習了VUE的列表排序過渡
碰見報錯
報錯之前程式碼為:
<transition-group name="flip-list" tag="div">
<van-cell v-for="(item,i) in list" v-bind:key="item.id">
{{item.name}}
<!-- 使用 right-icon 插槽來自定義右側圖示 -->
<template #right-icon>
<van-button round type="info" size="mini" @click="up(i,item)" v-show="i>0">上移</van-button>
<van-button round type="info" size="mini" @click="down(i,item)" v-show="i<list.length-1">下移</van-button>
</template>
</van-cell>
</transition-group>
解決報錯程式碼為:
<transition-group name="flip-list" tag="div">
<div v-for="(item,i) in list" v-bind:key="item.id">
<van-cell>
{{item.name}}
<!-- 使用 right-icon 插槽來自定義右側圖示 -->
<template #right-icon>
<van-button round type="info" size="mini" @click="up(i,item)" v-show="i>0">上移</van-button>
<van-button round type="info" size="mini" @click="down(i,item)" v-show="i<list.length-1">下移</van-button>
</template>
</van-cell>
</div>
</transition-group>
新增了一個div 把迴圈放在了div中 在這裡要注意key鍵繫結元素問題 設定錯誤會導致動畫不好用哦
相關文章
- vue專案報錯[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties startVue
- 細談 vue - transition-group 篇Vue
- [Vue warn]: $attrs is readonly;Webpack externals 配置VueWeb
- vue 路由自動化[讀取vue檔案目錄][支援children]Vue路由
- Q:[Vue warn]: Duplicate keys detected: ‘PAYACT‘. This may cause an update error.VueError
- [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined" found in <App> at src/App.vueVueErrorUndefinedAPP
- [Vue warn]: The data property "dialogVisible" is already declared as a prop. Use prop default valueVue
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- Property visible must be accessed with $ or _ are not proxied in the Vue instance to prevent錯誤Vue
- [Vue warn]: Invalid prop: type check failed for prop "unlinkPanels". Expected Boolean, got String with value "true".VueAIBooleanGo
- React的this.props.childrenReact
- react解析 React.Children(二)React
- school dictionary, kids dictionary, children dictionary
- vue輪播元件實現,$children和$parent,附帶好用的gif錄製工具Vue元件
- .NET8依賴注入新特性Keyed services依賴注入
- Flink狀態專題:keyed state和Operator state
- 解決vue3 頁面重新整理控制檯報[Vue Router warn]: No match found for location with path“xxxxx” 警告問題Vue
- JavaScript之childNodes 和 children 區別JavaScript
- [LeetCode] 3075. Maximize Happiness of Selected ChildrenLeetCodeAPP
- Flutter:VM snapshot must be valid. Check failed: vm. Must be able to initializeFlutterAI
- transition-group在table表格中失效的問題
- find: paths must precede expression:Express
- PostgreSQL DBA(193) - 資料傾斜下的HashJoinSQL
- 劍走偏鋒之Vue 元件通訊(一)—通過$parent和$children構建自己的通訊方式Vue元件
- guava cache大量的WARN日誌的問題分析Guava
- Qt QWidget Must construct a QApplication before a QWidgetQTStructAPP
- Property "visible" must be accessed with "$data.visible"
- 讓工作與(vue)音樂相伴Vue
- React元件中對子元件children進行加強React元件
- java 查詢資料庫並生成多層childrenJava資料庫
- PostgreSQL 原始碼解讀(193)- 查詢#109(排序#2 - ExecSort)SQL原始碼排序
- 【Redis】錯誤:failed: Hostname must not be empty or nullRedisAINull
- Solution - Codeforces 1166E The LCMs Must be Large
- TypeError: The ‘compilation‘ argument must be an instance of Compilation 報錯Error
- 深入解析Vue中的computed工作原理Vue
- 解決:java.lang.IllegalArgumentException: String must not be emptyJavaException
- Property "visible" must be accessed with "$data.visible" because properties
- python argument 1 must be 2-item sequence, not intPython