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值,删除的时候则不会重新渲染循环页面。

相关推荐
东东51619 小时前
xxx医患档案管理系统
java·spring boot·vue·毕业设计·智慧城市
码界奇点1 天前
基于Spring Boot和Vue3的无头内容管理系统设计与实现
java·spring boot·后端·vue·毕业设计·源代码管理
东东5161 天前
基于Web的智慧城市实验室系统设计与实现vue + ssm
java·前端·人工智能·后端·vue·毕业设计·智慧城市
不甘平凡的小鸟1 天前
vue3与cef3交互
前端·vue·cef3
武哥聊编程1 天前
【原创精品】基于Springboot3+Vue3的服装租赁平台
spring boot·mysql·vue·课程设计
weixin_439937762 天前
tortoiseGit 使用
java·前端·git·vue
.切切切 切萝卜2 天前
【vueconfig-proxy代理解决跨域问题】
vue·proxy模式
任小栗2 天前
uniappx实现app壳子,可直接拿来用
vue·uniapp
奔跑的web.2 天前
前端使用7种设计模式的核心原则
前端·javascript·设计模式·typescript·vue
千寻技术帮2 天前
10410_基于Springboot的文化旅游宣传网站
spring boot·后端·vue·源码·旅游·安装·在线旅游