前端批量删除(假删)

elementUI表格

html:
<div class="uploadButton" v-show="addShow">
	<el-button @click="deleteRow" :disabled="this.multipleSelection.length == 0">删除</el-button>
</div>
<el-table 
	:data ="fileList" border  
	class="uploadList"
	style=" 100%;margin:20px 0;"
	@selection-change="handleSelectionChange">
    <el-table-column type="selection" width="55"></el-table-column>

	<el-table-column label="图片" prop ="name" width="100">
		<template slot-scope="scope">
		        <i class="el-icon-document"></i>
	        </template>
	</el-table-column>
	<el-table-column label="标题" prop ="FILENAME" show-overflow-tooltip></el-table-column>
	<el-table-column label="大小" prop ="FILESIZE"  width="200"></el-table-column>
	<el-table-column label="创建人" prop ="CREATENAME" width="200"></el-table-column>
	<el-table-column label="创建时间" prop ="CREATEDATE" width="300"></el-table-column>
	<el-table-column label="文件格式" prop ="FILEFROMAT"  width="200"></el-table-column>
</el-table>
js:
handleSelectionChange(row) {
	this.multipleSelection = row;
},
deleteRow(){
      for(var i=0;i<this.multipleSelection .length;i++){
		for(var j=0;j<this.fileList.length;j++){
			if(this.fileList[j]==this.multipleSelection [i]){
				this.fileList.splice(j,1);
				j--;
			}
		}
	}
 }
原文地址:https://www.cnblogs.com/yinxingen/p/9540688.html