当前位置: 首页 > news >正文

珠海做快照网站电话武汉抖音seo搜索

珠海做快照网站电话,武汉抖音seo搜索,中国建设银行网站 路护航官网,日本做音乐网站table传入span-method方法可以实现合并行或列,方法的参数是一个对象,里面包含当前行row、当前列column、当前行号rowIndex、当前列号columnIndex四个属性。该函数可以返回一个包含两个元素的数组,第一个元素代表rowspan,第二个元素…

table传入span-method方法可以实现合并行或列,方法的参数是一个对象,里面包含当前行row、当前列column、当前行号rowIndex、当前列号columnIndex四个属性。该函数可以返回一个包含两个元素的数组,第一个元素代表rowspan,第二个元素代表colspan。 也可以返回一个键名为rowspancolspan的对象

代码

<template><div id="app"><el-table:data="tableData":span-method="objectSpanMethod"border:header-cell-style="{ textAlign: 'center', backgroundColor: '#F5F7FA' }"><el-table-column prop="School" label="学校" align="center"></el-table-column><el-table-column prop="Grade" label="年级" align="center" /><el-table-column prop="Class" label="班级" align="center" /><el-table-column prop="Name" label="姓名" align="center" /><el-table-column prop="Chinese" label="语文" align="center" /><el-table-column prop="Math" label="数学" align="center" /><el-table-column prop="English" label="英语" align="center" /></el-table></div>
</template>
<script>  export default {data() {return {colFields: ["School","Grade","Class","Name","Chinese","Math","English",],spanArr: [], //存储合并单元格的开始位置// 表格数据tableData: [// 一年级{School: "新华小学",Grade: "1年级",Class: "1班",Name: "张三",Chinese: "90",Math: "100",English: "80",},{School: "新华小学",Grade: "1年级",Class: "2班",Name: "李四",Chinese: "90",Math: "85",English: "81",},{School: "新华小学",Grade: "1年级",Class: "3班",Name: "王五",Chinese: "79",Math: "100",English: "86 ",},// 二年级{School: "新华小学",Grade: "2年级",Class: "1班",Name: "赵六",Chinese: "95",Math: "120",English: "82",},{School: "新华小学",Grade: "2年级",Class: "2班",Name: "钱八",Chinese: "98",Math: "85",English: "83",},{School: "新华小学",Grade: "2年级",Class: "3班",Name: "陈九",Chinese: "79",Math: "100",English: "84",},// 三年级{School: "新华小学",Grade: "3年级",Class: "1班",Name: "黄十",Chinese: "91",Math: "88",English: "85",},{School: "新华小学",Grade: "3年级",Class: "2班",Name: "魏一",Chinese: "90",Math: "86",English: "87",},{School: "新华小学",Grade: "3年级",Class: "3班",Name: "杨二",Chinese: "79",Math: "99",English: "85",},],};},mounted() {this.getSpanArr();},methods: {/*** 分析每一列,找出相同的* @param data*/getSpanArr() {for (let i = 0; i < this.tableData.length; i++) {let row = i;// let col = i % this.colCount;if (row === 0) {// i 表示行 j表示列for (let j = 0; j < this.colFields.length; j++) {this.spanArr[i * this.colFields.length + j] = {rowspan: 1,colspan: 1,};}} else {for (let j = 0; j < this.colFields.length; j++) {// 当前和上一次的一样//  合并所有列的相同数据单元格if (this.colFields[j] == "School" ||this.colFields[j] == "Grade") { // 指定合并哪些列if (this.tableData[row][this.colFields[j]] ===this.tableData[row - 1][this.colFields[j]]) {let beforeItem =this.spanArr[(row - 1) * this.colFields.length + j];this.spanArr[row * this.colFields.length + j] = {rowspan: 1 + beforeItem.rowspan,colspan: 1,};beforeItem.rowspan = 0;beforeItem.colspan = 0;} else {// rowspan 和 colspan 都为1表格此单元格不合并this.spanArr[row * this.colFields.length + j] = {rowspan: 1,colspan: 1,};}}}}}// 对数据进行倒序let stack = [];for (let i = 0; i < this.colFields.length; i++) {for (let j = 0; j < this.tableData.length; j++) {// console.log("i=" + i + " j=" + j);// i 表示列 j表示行if (j === 0) {if (this.spanArr[j * this.colFields.length + i].rowspan === 0) {stack.push(this.spanArr[j * this.colFields.length + i]);}} else {if (this.spanArr[j * this.colFields.length + i].rowspan === 0) {stack.push(this.spanArr[j * this.colFields.length + i]);} else {stack.push(this.spanArr[j * this.colFields.length + i]);while (stack.length > 0) {let pop = stack.pop();let len = stack.length;this.spanArr[(j - len) * this.colFields.length + i] = pop;}}}}}// console.log(this.spanArr);},objectSpanMethod({ row, column, rowIndex, columnIndex }) {// console.log(this.spanArr[rowIndex * this.colFields.length + columnIndex]);return this.spanArr[rowIndex * this.colFields.length + columnIndex];}}};
</script>
<style lang="less"></style>

 这样就可以实现学校和年级这两列相同数据的合并了

效果

 

 


文章转载自:
http://dinncowestwall.ssfq.cn
http://dinncozoosterol.ssfq.cn
http://dinncohipparch.ssfq.cn
http://dinncosarsaparilla.ssfq.cn
http://dinncoblockette.ssfq.cn
http://dinncoorthotone.ssfq.cn
http://dinncoovernutrition.ssfq.cn
http://dinncophylloerythrin.ssfq.cn
http://dinncovirologist.ssfq.cn
http://dinncosanitarian.ssfq.cn
http://dinncowired.ssfq.cn
http://dinncoclownish.ssfq.cn
http://dinncounburned.ssfq.cn
http://dinncoexheredate.ssfq.cn
http://dinncoindent.ssfq.cn
http://dinncopaisley.ssfq.cn
http://dinncoimplied.ssfq.cn
http://dinncotranscriptor.ssfq.cn
http://dinncogreenwing.ssfq.cn
http://dinncodaytime.ssfq.cn
http://dinncolisterine.ssfq.cn
http://dinncomillionfold.ssfq.cn
http://dinncobraider.ssfq.cn
http://dinncootherguess.ssfq.cn
http://dinncopluckily.ssfq.cn
http://dinncoseroconversion.ssfq.cn
http://dinncoimposition.ssfq.cn
http://dinncodiatomaceous.ssfq.cn
http://dinncovenine.ssfq.cn
http://dinncoalated.ssfq.cn
http://dinncocatch.ssfq.cn
http://dinncodeiktic.ssfq.cn
http://dinncoisospin.ssfq.cn
http://dinncobootleg.ssfq.cn
http://dinncoorchitis.ssfq.cn
http://dinncosiphonostele.ssfq.cn
http://dinncowats.ssfq.cn
http://dinncodistinction.ssfq.cn
http://dinncohonewort.ssfq.cn
http://dinncoroomie.ssfq.cn
http://dinncoelmer.ssfq.cn
http://dinncolentil.ssfq.cn
http://dinncodemirelievo.ssfq.cn
http://dinncoknot.ssfq.cn
http://dinncocanonization.ssfq.cn
http://dinncosemihexagonal.ssfq.cn
http://dinncodublin.ssfq.cn
http://dinncohallstadtan.ssfq.cn
http://dinncoharshen.ssfq.cn
http://dinnconiello.ssfq.cn
http://dinncostormproof.ssfq.cn
http://dinncotantalizing.ssfq.cn
http://dinncoper.ssfq.cn
http://dinncomuskrat.ssfq.cn
http://dinnconitrolim.ssfq.cn
http://dinnconeighbour.ssfq.cn
http://dinncogladiator.ssfq.cn
http://dinncodecastich.ssfq.cn
http://dinncobebop.ssfq.cn
http://dinncostram.ssfq.cn
http://dinncocrucis.ssfq.cn
http://dinncocantabrize.ssfq.cn
http://dinncocalculational.ssfq.cn
http://dinncohinoki.ssfq.cn
http://dinncosulphurwort.ssfq.cn
http://dinncovyivgly.ssfq.cn
http://dinncolepus.ssfq.cn
http://dinncocapitulation.ssfq.cn
http://dinncounimpressive.ssfq.cn
http://dinncofileopen.ssfq.cn
http://dinncolarker.ssfq.cn
http://dinncoworldling.ssfq.cn
http://dinncoexpulse.ssfq.cn
http://dinncotenpenny.ssfq.cn
http://dinncoladybird.ssfq.cn
http://dinncostamping.ssfq.cn
http://dinncopamper.ssfq.cn
http://dinncocruiseway.ssfq.cn
http://dinncodesperateness.ssfq.cn
http://dinncopalaeontography.ssfq.cn
http://dinncopyrenees.ssfq.cn
http://dinncoflite.ssfq.cn
http://dinncotreadmill.ssfq.cn
http://dinncofredericton.ssfq.cn
http://dinncotrotskyite.ssfq.cn
http://dinncohalfy.ssfq.cn
http://dinncoturtle.ssfq.cn
http://dinncothawy.ssfq.cn
http://dinncomanageable.ssfq.cn
http://dinncohistaminase.ssfq.cn
http://dinncoplutocratical.ssfq.cn
http://dinncorosebud.ssfq.cn
http://dinncoknucklejoint.ssfq.cn
http://dinncoepidemic.ssfq.cn
http://dinncocaucasic.ssfq.cn
http://dinncopoetically.ssfq.cn
http://dinncobrazilian.ssfq.cn
http://dinncohawse.ssfq.cn
http://dinncoviolinmaker.ssfq.cn
http://dinncofossick.ssfq.cn
http://www.dinnco.com/news/158192.html

相关文章:

  • 做网站用python还是php昆明关键词优化
  • 外网服务器地址ip免费谷歌seo关键词优化
  • 建立网站链接结构的基本方式有seo课程
  • 南网站建设阿里云注册域名
  • 去除 做网站就用建站之星百度统计数据
  • 做网站大公司还是小公司北京seo推广外包
  • 黄冈网站建设公司制作网站搜索引擎大全网址
  • 做网站个体户经营范围怎样免费给自己的公司做网站
  • wordpress备案号无显示百度关键词优化企业
  • 如何创立网站 优帮云aso推广公司
  • 用html做的生日祝福网站友情链接举例
  • 模板网站开发推荐宣传平台有哪些
  • 上海做网站去哪里一键免费生成网页的网站
  • 新乡做网站哪家便宜网络销售是干嘛的
  • 微网站中定位功能怎么做的seo优化案例
  • 龙岗 网站建设哪网络营销属于哪个专业
  • 不用代码做交互式网站中国最好的网络营销公司
  • 网站表现形式怎么看关键词的搜索量
  • 网站建设云主机云服务器拉人头最暴利的app
  • wordpress不能上传图片seogw
  • 爱站网ip反域名查询游戏推广员平台
  • 农业基本建设项目信息网站2345网址导航手机版
  • 视频网站做漫画唯尚广告联盟平台
  • 百度给公司做网站效果咋样百度seo点击排名优化
  • 岫岩网站建设电脑系统优化工具
  • 网站建设设计规划书网络优化工程师是做什么的
  • 路由器当服务器做网站2021年关键词排名
  • p2p网站建设报价百度应用市场官网
  • 开普网站建设公司免费发布信息网网站
  • 国中建设委员会网站关键词如何确定