工作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路由
- JavaScript childrenJavaScript
- jQuery children()jQuery
- Overview of Synonyms (193)View
- [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined" found in <App> at src/App.vueVueErrorUndefinedAPP
- Q:[Vue warn]: Duplicate keys detected: ‘PAYACT‘. This may cause an update error.VueError
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- [Vue warn]: Attribute "id" is ignored on component because the component is a fragment instanVueFragment
- Property visible must be accessed with $ or _ are not proxied in the Vue instance to prevent錯誤Vue
- .NET8依賴注入新特性Keyed services依賴注入
- [Vue warn]: The data property "dialogVisible" is already declared as a prop. Use prop default valueVue
- vue輪播元件實現,$children和$parent,附帶好用的gif錄製工具Vue元件
- react解析 React.Children(二)React
- React的this.props.childrenReact
- jQuery的addClass,children,showjQuery
- transition-group在table表格中失效的問題
- [Vue warn]: Invalid prop: type check failed for prop "unlinkPanels". Expected Boolean, got String with value "true".VueAIBooleanGo
- It's a must to ghd
- JavaScript之childNodes 和 children 區別JavaScript
- school dictionary, kids dictionary, children dictionary
- 怎樣解決 [Vue warn]: The computed property "count" is already defined in data. 報錯問題?Vue
- topcoder SRM 619 DIV2 GoodCompanyDivTwoGo
- XX must be built with ARCUI
- npm WARN unmet dependency錯誤解決方法NPM
- find: paths must precede expression:Express
- Flutter:VM snapshot must be valid. Check failed: vm. Must be able to initializeFlutterAI
- PostgreSQL DBA(193) - 資料傾斜下的HashJoinSQL
- 劍走偏鋒之Vue 元件通訊(一)—通過$parent和$children構建自己的通訊方式Vue元件
- 讓工作與(vue)音樂相伴Vue
- vue-cli是如何工作的Vue
- Mount: you must specify the filesystem type
- Oracle 11G OCP 1Z0-053 193Oracle
- Oracle OCP IZ0-053 Q193(rman recover)Oracle
- guava cache大量的WARN日誌的問題分析Guava
- React元件中對子元件children進行加強React元件