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

推荐订阅源

云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 叶小钗
F
Fortinet All Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 最新话题
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
PCI Perspectives
PCI Perspectives
Cloudbric
Cloudbric
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
IT之家
IT之家
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
M
MIT News - Artificial intelligence
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Microsoft Security Blog
Microsoft Security Blog
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
G
Google Developers Blog
W
WeLiveSecurity
罗磊的独立博客
P
Privacy & Cybersecurity Law Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Secure Thoughts
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed

博客园 - 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