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