element UI table 单元格合并总计行

element UI table 单元格合并总计行,第1张

  
        
          
          
        
      
设置 id=“editAbleTrends”
 mounted () {
    // 获取优选规则列表
    this.getInfo()
  },
  methods: {
    getInfo () {
      this.tableloading = true
      queryAll({
        mold: "yx"
      }).then(res => {
        if (!res) return
        if (res.primaryOpinionList.length) {
          this.primaryOpinionList = res.primaryOpinionList
        } else {
          this.primaryOpinionList.push(
            {
              survey: '',//评选内容
              surveyStr: '',//评选标准
              score: 0,//最高得分
              sort: 1, //排序
              isHide: true, //默认展示
              mold: "yx"
            }
          )
        }
        const tables = document.querySelectorAll(
          "#editAbleTrends .el-table__footer-wrapper tr>td"
        );
        console.log("tables", tables);
        tables[0].colSpan = 3;
        tables[0].style.textAlign = "center";
        tables[1].style.display = "none";
        tables[2].style.display = "none";
        tables[3].style.textAlign = "center";
        tables[4].style.textAlign = "center";
        // 获取总计
        this.numChange()
        this.tableloading = false
      })
    }
}
在mounted 写的方法里调用js代码

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/669998.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-19
下一篇 2022-04-19

发表评论

登录后才能评论

评论列表(0条)

保存