因为习惯太久的黑暗,所以阳光愈加刺眼!

空一座旧城,守一个旧人

前端批量删除(假删)

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="width: 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--;
			}
		}
	}
 }

posted on 2018-08-27 10:29  空一座旧城,守一个旧人  阅读(1783)  评论(1编辑  收藏  举报

导航