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

iview 老版本合并单元格

新版的iview中已经支持了合并单元格了,我的版本比较老,为:"iview": "^3.5.2"。暂不支持。记录一下别的大佬的方法。感觉思路比较活,正在这种思路需要在解决问题的过程中学习。

核心思路:通过render方法,加上设置样式实现看似合并单元格。
代码如下:

data数据

dataList = [{index: '1',indexName: 'a',rate: '35%',standard: '描述11111',list: [{ info: "规则1", score: "100" },{ info: "规则2", score: "80" },{ info: "规则3", score: "60" },{ info: "规则4", score: "40" },]},{index: '2',indexName: 'b)',rate: '30%',standard: '描述2222'',list: [{ info: "规则1", score: "100" },{ info: "规则2", score: "80" },{ info: "规则3", score: "60" },{ info: "规则4", score: "40" },] }, ]

列的数据,在此数据中通过render来控制

    columns: any[] = [{title: '序号',key: 'index'},{title: '指标',key: 'indexName'},{title: '权重',key: 'rate'},{title: '评分标准',key: 'standard'},{title: '详情',key: 'list',width: 250,render: (h, params) => { return h('div', {attrs: {class: 'subCol'},}, [h('ul', params.row.list.map(item => {return h('li', {}, item.info)}))])}},{title: '分值',key: 'list',width: 100,render: (h, params) => {  return h('div', {attrs: {class: 'subCol'},}, [h('ul', params.row.list.map(item => {return h('li', {}, item.score)}))])}}, ] 

组件代码

<Table :columns="columns" :data="dataList"  :loading="loading" border></Table>

css

.subCol>ul>li {margin: 0 -18px;list-style: none;text-Align: center;padding: 9px;border-bottom: 1px solid #ccc;overflow-x: hidden;
}.subCol>ul>li:last-child {border-bottom: none
}

实现效果


image.png

参考网站:
https://blog.csdn.net/weixin_34138139/article/details/88600460



喜欢的朋友记得点赞、收藏、关注哦!!!


文章转载自:

http://hGd6k3RS.nynzs.cn
http://b0r1YsXH.nynzs.cn
http://wkpVJJkz.nynzs.cn
http://RzLnytJz.nynzs.cn
http://rGWGbbnR.nynzs.cn
http://MQ9zpKgC.nynzs.cn
http://m2yf4sn0.nynzs.cn
http://1xVRAxAh.nynzs.cn
http://lYhQD9ge.nynzs.cn
http://Kw6Iq9sy.nynzs.cn
http://hKTNcZw1.nynzs.cn
http://3OaB3Nhl.nynzs.cn
http://GQOlQM8u.nynzs.cn
http://g4rzmBdU.nynzs.cn
http://aEv3AItq.nynzs.cn
http://DuQLOm7E.nynzs.cn
http://SiZQEvmX.nynzs.cn
http://crqQtlFx.nynzs.cn
http://6AfwSAvR.nynzs.cn
http://3DG7icRr.nynzs.cn
http://8iBAKNmb.nynzs.cn
http://nANGFEcd.nynzs.cn
http://pAPd8D6p.nynzs.cn
http://zAuoRG44.nynzs.cn
http://ufKklRJj.nynzs.cn
http://rs11o9Uj.nynzs.cn
http://DfZyQg9h.nynzs.cn
http://Y8oKDs2v.nynzs.cn
http://vJXg2UBL.nynzs.cn
http://dhCx6mdV.nynzs.cn
http://www.dtcms.com/a/171226.html

相关文章:

  • Javase 基础加强 —— 03 集合
  • nt!MiSessionAddProcess函数分析和nt!MmSessionSpace全局变量的关系
  • 基于注解脱敏+链路追踪traceId 快速定位错误
  • VSCode常用插件推荐
  • 普通IT的股票交易成长史--20250504实盘记录
  • 什么是unordered_map?用大白话说
  • GitLab CI/CD变量使用完全指南
  • 《奇迹世界起源》:宝箱工坊介绍!
  • 2025-04-26-利用奇异值重构矩阵-美团
  • 日本人工智能发展全景观察:从技术革新到社会重构的深度解析
  • 研0大模型学习(第11天)
  • AUTOSAR图解==>AUTOSAR_SWS_V2XManagement
  • Y1模拟一 补题报告
  • Electron 从零开始:构建你的第一个桌面应用
  • 状态值函数与状态-动作值函数
  • SQL手工注入(DVWA)
  • n8n 构建一个 ReAct AI Agent 示例
  • Dify 完全指南(一):从零搭建开源大模型应用平台(Ollama/VLLM本地模型接入实战)》
  • QT聊天项目DAY07
  • MPI,Pthreads和OpenMP等并行实验环境配置
  • n8n 快速入门2:构建自动化工作流
  • Scartch038(四季变换)
  • SSE技术的基本理解以及在项目中的使用
  • C++日志系统实现(一)
  • redis----通用命令
  • windows鼠标按键自定义任意设置
  • ubuntu修改时区和设置24小时格式时间
  • 分布式系统中的 ActiveMQ:异步解耦与流量削峰(一)
  • 潮乎盲盒商城系统全开源多级分销推广海报奖品兑换试玩概率OSS云存储多端源码
  • 《Java高级编程:从原理到实战 - 进阶知识篇五》