Giter Site home page Giter Site logo

Comments (7)

zollero avatar zollero commented on May 27, 2024

你好,多级表头是比较新的特性,目前没有做专门的整合,不过你应该可以自己定义 slot 来实现。

比如,官方的例子:

<template>
  <el-table
    :data="tableData3"
    style="width: 100%">
    <el-table-column
      prop="date"
      label="日期"
      width="150">
    </el-table-column>
    <el-table-column label="配送信息">
      <el-table-column
        prop="name"
        label="姓名"
        width="120">
      </el-table-column>
      <el-table-column label="地址">
        <el-table-column
          prop="province"
          label="省份"
          width="120">
        </el-table-column>
        <el-table-column
          prop="city"
          label="市区"
          width="120">
        </el-table-column>
        <el-table-column
          prop="address"
          label="地址"
          width="300">
        </el-table-column>
        <el-table-column
          prop="zip"
          label="邮编"
          width="120">
        </el-table-column>
      </el-table-column>
    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    data() {
      return {
        tableData3: [{
          date: '2016-05-03',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-02',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-04',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-01',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-08',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-06',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }, {
          date: '2016-05-07',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }]
      }
    }
  }
</script>

可以通过这样的slot 来实现,请见下面的示例及效果:

https://codepen.io/zollero/pen/yqqQZO

from el-search-table-pagination.

zollero avatar zollero commented on May 27, 2024

暂不支持,我试了一下,用 slotName 的方式迁入还有点问题

from el-search-table-pagination.

hanzhenchaoGit avatar hanzhenchaoGit commented on May 27, 2024

不过我做了一个临时的比较笨的方案 就是可以在组件里面手写三层遍历 一般表格最多也不超过3层表头不是?

from el-search-table-pagination.

zollero avatar zollero commented on May 27, 2024

是的😅

from el-search-table-pagination.

chenjing0823 avatar chenjing0823 commented on May 27, 2024

@hanzhenchaoGit 您这边比较“笨”的三层遍历是如何遍历的。

from el-search-table-pagination.

hanzhenchaoGit avatar hanzhenchaoGit commented on May 27, 2024

@hanzhenchaoGit 您这边比较“笨”的三层遍历是如何遍历的。

现在是用递归的方式处理了

from el-search-table-pagination.

changming1987117 avatar changming1987117 commented on May 27, 2024

@hanzhenchaoGit 您这边比较“笨”的三层遍历是如何遍历的。

现在是用递归的方式处理了

请问有代码示例吗?

from el-search-table-pagination.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.