zoukankan      html  css  js  c++  java
  • vue 基于element组件库实现表格下多个子级展示

    实现效果

    <template>
      <div class="content-right-table">
        <el-table
          ref="tableData"
          :data="tableData"
          tooltip-effect="light"
          style=" 100%"
          @expand-change="handle_list"
        >
          <el-table-column prop="children" type="expand" width="100">
            <template slot-scope="slots">
              <el-table
                ref="subTableData"
                :data="slots.row.children"
                tooltip-effect="light"
                @expand-change="handle_subList"
              >
                <el-table-column prop="children" type="expand" width="100">
                  <template slot-scope="scopes">
                    <el-table ref="secSubTableData" :data="scopes.row.children" tooltip-effect="light">
                      <el-table-column prop="portNumber" label="编号" />
                      <el-table-column prop="name" label="名称" />
                      <el-table-column prop="ip" label="IP" />
                      <el-table-column label="操作" width="200">
                        <template slot-scope="scope">
                          <el-button type="text" class="primary-text" @click="handle_edit(scope.row)">编辑</el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </template>
                </el-table-column>
                <el-table-column prop="number" label="编号" />
                <el-table-column prop="size" label="大小" />
                <el-table-column label="操作" width="200">
                  <template slot-scope="scope">
                    <el-button type="text" class="danger-text" @click="handle_delete(scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </template>
          </el-table-column>
    
          <el-table-column label="ID" show-overflow-tooltip>
            <template slot-scope="scope">{{ scope.row.rtuId }}</template>
          </el-table-column>
          <el-table-column label="名称" show-overflow-tooltip>
            <template slot-scope="scope">
              <div @click="handle_jump(scope.row)">
                <span size="medium">{{ scope.row.name }}</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="count" label="数量" />
        </el-table>
      </div>
    </template>
    
    js部门
    tableData: [
            {
              rtuId: '4564651',
              children: [
                {
                  children: [
                    {
                      portNumber: '001',
                      name: '001',
                      ip: '001',
                      portNumber: '001',
                    },
                  ],
                  number: 132123,
                  size: 1231231,
                },
              ],
              name: 'fdsf',
              count: '123121',
            },
            {
              rtuId: '4564651',
              children: [
                {
                  children: [
                    {
                      portNumber: '001',
                      name: '001',
                      ip: '001',
                      portNumber: '001',
                    },
                  ],
                  number: 132123,
                  size: 1231231,
                },
              ],
              name: 'fdsf',
              count: '123121',
            },
          ],
    
    样式比较丑,大家需要的自己调整
  • 相关阅读:
    SQLite Java Wrapper/JDBC Driver(收集)
    JAVA 并行运行(收集)
    log4net使用方法(转载)
    WMI服务故障,VBS脚本无法运行错误
    ArcEngine中UID使用资料收集
    使用 ArcGIS Engine Runtime 制作安装包(转载)
    Eclipse安装WindowBuilder Pro(转载)
    C#操作SQL Server数据库
    自动化测试 (三) Web自动化测试原理
    HTTP协议 (六) 状态码详解
  • 原文地址:https://www.cnblogs.com/j-j-h/p/13691605.html
Copyright © 2011-2022 走看看