<vue-draggable-resizable
   v-for="(item,index) in pictureList"
   :parent="true"
   :w="item.width"
   :h="item.height"
   :key="index"
   :y="item.y"
   @activated="onActivated(index)">
    <el-image :src="item.src"></el-image>
</vue-draggable-resizable>
onActivated(index){
      let that = this
      document.onkeydown = function(event){
				if(event.code=="Delete"){
          that.pictureList.splice(index,1)
        }
	}
 },

绑定选中事件,然后监听键盘按下,然后删除index指定的框

GitHub 加速计划 / vu / Vue.Draggable
4
1
下载
SortableJS/Vue.Draggable: Vue.Draggable 是 Sortable.js 的 Vue.js 封装组件,提供了拖放排序功能,可以在 Vue 应用中轻松实现列表元素的可拖拽重排。
最近提交(Master分支:11 天前 )
431db153 - 3 年前
017ab498 - 4 年前
Logo

新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐