【 antd and vue 中实现table单元格合并解决方法】

【 antd and vue 中实现table单元格合并解决方法】,第1张

antd and vue 中实现table单元格合并解决方法 antd and vue 中实现table单元格合并解决方法

antd and vue 中实现table单元格合并解决方法
columns: [
        {
          title: "月份",
          dataIndex: "title",
          width: "180px",
          align: "center",
          customRender: (value, row, index) => {
            let obj = {
              attrs: {},
            };
            if (index === 0) {
              obj = {
                children: "月计划取水量(万m³)",
                attrs: { rowSpan: 1,},
              };
            }
            if (index === 1) {
              obj = {
                children: "月许可用水量(万m³)",
                attrs: { rowSpan: 2, },
              };
            }
            if (index === 2) {
              obj = {
                children: "月许可用水量(万m³)",
                attrs: { rowSpan: 0 },
              };
            }
            return obj;
          },
        },
        {
          title: "1月",
          dataIndex: "jan",
          align: "right",
          scopedSlots: { customRender: "jan" },
        },
        {
          title: "2月",
          dataIndex: "feb",
          align: "right",
          scopedSlots: { customRender: "feb" },
        },
        {
          title: "3月",
          dataIndex: "mar",
          align: "right",
          scopedSlots: { customRender: "mar" },
        },
        {
          title: "4月",
          dataIndex: "apr",
          align: "right",
          scopedSlots: { customRender: "apr" },
        },
        {
          title: "5月",
          dataIndex: "may",
          align: "right",
          scopedSlots: { customRender: "may" },
        },
        {
          title: "6月",
          dataIndex: "jun",
          align: "right",
          scopedSlots: { customRender: "jun" },
        },
        {
          title: "7月",
          dataIndex: "jul",
          align: "right",
          scopedSlots: { customRender: "jul" },
        },
        {
          title: "8月",
          dataIndex: "aug",
          align: "right",
          scopedSlots: { customRender: "aug" },
        },
        {
          title: "9月",
          dataIndex: "sep",
          align: "right",
          scopedSlots: { customRender: "sep" },
        },
        {
          title: "10月",
          dataIndex: "oct",
          align: "right",
          scopedSlots: { customRender: "oct" },
        },
        {
          title: "11月",
          dataIndex: "nov",
          align: "right",
          scopedSlots: { customRender: "nov" },
        },
        {
          title: "12月",
          dataIndex: "dec",
          align: "right",
          scopedSlots: { customRender: "dec" },
        },
        {
          title: " *** 作",
          dataIndex: "action",
          width: "96px",
          align: "center",
          scopedSlots: { customRender: "action" },
        },
      ],

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

原文地址: http://outofmemory.cn/web/1299048.html

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

发表评论

登录后才能评论

评论列表(0条)

保存