🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[toc] ### 1. 实现单个删除和批量删除 ``` <Button icon="ios-search" class="mr-2" v-if="checkedCount" @click="deleteItem(0)">删除</Button> // 删除 deleteItem(id = 0){ this.$Modal.confirm({ title:"提示", content:"是否删除选中文件?", onOk:()=>{ let ids = [] ids = id > 0 ? id : this.checkList.map(item=>item.id).join(',') this.axios.post('/api/file/delete',{ ids },{ token:true }).then(res=>{ this.$Message.success('删除成功') this.getData() }) } }) }, switch (e.type){ case 'delete': this.deleteItem(e.item.id) ```