惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security @ Cisco Blogs
罗磊的独立博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
美团技术团队
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
博客园 - Franky
G
Google Developers Blog
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
腾讯CDC
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements
博客园 - 叶小钗
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
L
LangChain Blog
Vercel News
Vercel News
Forbes - Security
Forbes - Security
PCI Perspectives
PCI Perspectives
N
News | PayPal Newsroom
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
J
Java Code Geeks
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hacker News: Ask HN
Hacker News: Ask HN
Schneier on Security
Schneier on Security
A
About on SuperTechFans
Attack and Defense Labs
Attack and Defense Labs
Google Online Security Blog
Google Online Security Blog
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Cloudbric
Cloudbric
B
Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

博客园 - VipSoft

Python 项目简单部署(Linux) MinerU - 将非结构化文档(PDF、图片、Office 文件等)转换为机器可读的 Markdown 和 JSON LangChain 入门 服务端部署-FastAPI LangChain 入门 LangSmith LangChain 入门 实战 - 食谱推荐 LangChain 入门 Memory 会话记忆 LangChain 入门 Tools 工具 LangChain 入门 Tools 工具 LangChain 入门 Prompts 提示词 LangChain 入门 Message 消息 LangChain 入门 Model 的初始化和调用 LangChain 入门 Agent 的基本运行机制 AI 0基础学习,名词解析 LangChain 和 LangGraph AI大模型知识体系 Dify — Workflow - 数据可视化 Dify — 连接MySQL配置 Dify — Chatflow - 数据库智能查询 Dify — Chatflow - 文档知识库 Dify — Agent 智能体 高安全券码、注册码生成 Dify — 文本生成应用 Dify — 聊天助手 -- 知识库 Windows 下 Docker 安装 Dify Ollama — 命令 Ollama — 为什么能够运行不同的模型 Ollama — 接口 Qwen — 自定义模型文件 Ollama Qwen — 安装测试 Ollama Windows 安装 & 指定安装目录 跟着AI学AI - 诊断结论信息抽取 - 批量处理脚本 跟着AI学AI - 诊断结论信息抽取 - 模型压缩与部署 跟着AI学AI - 诊断结论信息抽取 - 模型评估与调试 跟着AI学AI - 诊断结论信息抽取 - 模型训练 轻型民用无人驾驶航空器安全操控理论考试培训材料 FreeRedis Helper Windbg w3wp.DMP 内存分析 跟着AI学AI - 诊断结论信息抽取 - 数据增强 QQ 录屏软件 Java - 加权随机算法 - 示例 Java - 加权随机算法--Demo Java LoadBalanceUtil 负载均衡、轮询加权 SpringBoot 集成 IP2Region 获取IP地域信息 Windows 服务器和虚拟主机,创建.开头的文件夹 .well-known 跟着AI学AI - 诊断结论信息抽取 - 数据格式转换BERT训练格式 跟着AI学AI - 诊断结论信息抽取 - LabelStudio 标注 -- 结论标注 跟着AI学AI - 诊断结论信息抽取 - 学习路径 跟着AI学AI - UV 安装 数据标注工具 Label-Studio `VIRTUAL_ENV=venv` does not match the project environment 跟着AI学AI - 学习路径 - 命名实体识别(NER)和信息抽取(IE) 跟着AI学AI - 需要购买显卡吗? C# 无BOM的UTF-8编码 Vue ref reactive Spring `@Scheduled` 中这些参数的区别、组合和应用场景 Python 找出同步日志中的重复数据 Python - UV PyCharm 不能识别 .venv 的环境
Vue - el-table 嵌套表
VipSoft · 2026-01-09 · via 博客园 - VipSoft

使用 el-table 实现表格嵌套效果

<template>
  <el-card shadow="never">
    <el-table :data="tableData" border class="detail-table">
      <el-table-column prop="ReportTitleName" label="名称" width="120" />
      <el-table-column prop="detail" label="明细" class-name="detail-column">
        <template #default="scope">
          <table class="inner-table">
            <tbody>
              <tr v-for="(item, index) in scope.row.Price" :key="index">
                <td class="inner-td">{{ item.MonitorHour }}小时</td>
                <td class="inner-td">{{ item.Price }}元</td>
              </tr>
            </tbody>
          </table>
        </template>
      </el-table-column>
      <el-table-column
        v-hasPerm="'DeviceAdd'"
        width="130"
        fixed="right"
        label="操作"
        prop="describe"
      >
        <template #default="scope">
          <el-button
            type="primary"
            icon="edit"
            link
            size="small"
            @click="handleOpenEditDialog(scope.row)"
          >
            编辑
          </el-button>
          <el-button
            type="primary"
            icon="edit"
            link
            size="small"
            @click="handleOpenRemarkDialog(scope.row)"
          >
            备注
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script setup>
import { ref } from "vue";

const tableData = ref([
  {
    TitleLevel: 11,
    ReportTitleName: "张三",
    Price: [
      { MonitorHour: 24, Price: 0.01 },
      { MonitorHour: 72, Price: 0.02 },
      { MonitorHour: 168, Price: 0.03 },
    ],
  },
  {
    TitleLevel: 21,
    ReportTitleName: "李四",
    Price: [
      { MonitorHour: 24, Price: 0.1 },
      { MonitorHour: 72, Price: 0.2 },
      { MonitorHour: 168, Price: 0.3 },
    ],
  },
]);
</script>

<style scoped>
/* 只针对明细列的表头 */
:deep(.detail-column.is-leaf) {
  padding: 0 !important;
}

/* 只针对明细列的单元格 */
:deep(.detail-column) {
  padding: 0 !important;
}

/* 内部表格样式 */
.inner-table {
  width: 100%;
  border-collapse: collapse;
  margin: -1px; /* 消除双边框重叠 */
}

.inner-td {
  width: 50%;
  border: 1px solid #ebeef5;
  padding: 8px 10px;
  text-align: center;
  height: 40px;
  box-sizing: border-box;
}

/* 调整内部表格边框,避免重复 */
.inner-table tr:last-child td {
  border-bottom: none;
}

.inner-table td:last-child {
  border-right: none;
}

/* 确保明细列内容区域没有内边距 */
:deep(.detail-column .cell) {
  padding: 0 !important;
  line-height: normal;
}

/* 保持名称列的正常内边距 */
:deep(.el-table__cell:not(.detail-column)) {
  padding: 8px 0 !important; /* 正常的内边距 */
}

:deep(.el-table__cell:not(.detail-column) .cell) {
  padding: 0 10px !important; /* 正常的内边距 */
}
</style>

效果如下
image