vue3-drag-resize 拖拽 拉伸 循环 并删除

            <VueDragResize :isResizable="false" :w="478" :h="278" :x="-478" v-show="legendList.length"
                v-for="(item,index) in legendList" :key="item.name">
                <div class="legend-list">
                    <img src="@/assets/img/mapIcon(29).png" alt="" class="layer-close cur" @click="closeLegendList(index)">
                    <div class="v-flex1 v-scriollbar legend-list-contain">
                        <div class="v-flex2 v-m-r20" v-for="i in item.legends">
                            <div class="v-title-msg">{{ i.name }}</div>
                            <div class="legend-list-icon">
                                <div v-for="items in i.legendList" class="v-flex1 v-jc-fs v-ai-c">
                                    <img :src="items.img ? items.img : commonIcon" alt="">
                                    <div class="legend-list-title">{{ items.legendName }}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </VueDragResize>

注意循环的时候不要用index作为唯一的key,这样会导致删除的时候index改变而导致页面重新渲染,使用不会变的key值,删除的时候则不会重新渲染循环页面。

相关推荐
hello_fracong9 分钟前
3.Vue2结合element-ui实现国际化多语言i18n
vue
码力码力我爱你5 小时前
QT + WebAssembly + Vue环境搭建
vue.js·vue·wasm·webassembly·emscripten
尸僵打怪兽13 小时前
后台数据管理系统 - 项目架构设计-Vue3+axios+Element-plus(0916)
vue.js·vue
是梦终空1 天前
JAVA毕业设计176—基于Java+Springboot+vue3的交通旅游订票管理系统(源代码+数据库)
java·spring boot·vue·毕业设计·课程设计·源代码·交通订票
天下无贼!1 天前
2024年最新版Vue3学习笔记
前端·vue.js·笔记·学习·vue
这个需求建议不做1 天前
vue3打包配置 vite、router、nginx配置
前端·nginx·vue
QGC二次开发1 天前
Vue3 : Pinia的性质与作用
前端·javascript·vue.js·typescript·前端框架·vue
罗_三金1 天前
前端框架对比和选择?
javascript·前端框架·vue·react·angular
一个很帅的帅哥2 天前
实现浏览器的下拉加载功能(类似知乎)
开发语言·javascript·mysql·mongodb·node.js·vue·express
孟诸2 天前
计算机专业毕设-校园新闻网站
java·vue·毕业设计·springboot·课程设计