elementui的table合并第一列的单元格

elementui的table合并第一列的单元格_第1张图片

<el-table empty-text="暂无数据" :data="yhmxdb" :span-method="yhmxdbMethod" :header-cell-style="{ background: 'rgb(224,224,224)', color: '#000' }" stripe max-height="300" style="width: 100%;margin-bottom: 10px;">
	<el-table-column prop="xm" label="项目"></el-table-column>
	<el-table-column prop="yhmx" label="模型"></el-table-column>
	<el-table-column prop="pc" label="频次"></el-table-column>
	<el-table-column prop="sc" label="时长(分钟)"></el-table-column>
	<el-table-column prop="jz" label="均值(分钟)"></el-table-column>
</el-table>
yhmxdb: [{
			xm: "传",
			yhmx: "断",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		}, {
			xm: "传",
			yhmx: "主",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		},
		{
			xm: "传",
			yhmx: "主",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		},
		{
			xm: "传",
			yhmx: "叶",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		},
		{
			xm: "传",
			yhmx: "主",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		},
		{
			xm: "传",
			yhmx: "主",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		},
		{
			xm: "传",
			yhmx: "主",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		}, {
			xm: "传",
			yhmx: "风",
			pc: "2000",
			sc: "0.35",
			jz: "1500",
		}
	],
methods: {
	yhmxdbMethod({row,column,rowIndex,columnIndex}) {
		console.log(rowIndex+"=="+columnIndex)
		if (rowIndex <= 8) {
		  if (rowIndex === 0 && columnIndex === 0) {
			return [8, 1];
		  }else if (rowIndex >= 1 && columnIndex === 0){
			  return [0, 0];
		  }
		}
	},
}

你可能感兴趣的:(vue,elementui)