Skip to content

「彻底解放双手」的建议  #223

@kele59

Description

@kele59

Please follow the issue template, or your issue may be closed automatically.

For bug report, provide the following section

Online reproduce

感谢作者的 vue-data-tablesel-form-dialog,我的管理后台项目中大量使用了它们,真心舒服~省了很多代码(先舔一波😂)

不过我觉得这些加起来还是没有彻底解放双手,有个痛点没解决:
平时我们使用的 element table 时候往往是这样写的

    <el-table-column
      label="日期"
      width="180">
      <template scope="scope">
        <el-icon name="time"></el-icon>
        <span style="margin-left: 10px">{{ scope.row.date }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="姓名"
      width="180">
      <template scope="scope">
        <el-popover trigger="hover" placement="top">
          <p>姓名: {{ scope.row.name }}</p>
          <p>住址: {{ scope.row.address }}</p>
          <div slot="reference" class="name-wrapper">
            <el-tag>{{ scope.row.name }}</el-tag>
          </div>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="操作">
      <template scope="scope">
        <el-button
          size="small"
          @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button
          size="small"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>

各种 el-table-columntemplate scope="scope 神烦,大量重复冗余不利于维护,而且还不能复用。。

于是在发现了 Egrid,解决了这个痛点

Egrid 的源码实现很简单,然后我突发奇想能不能实现 egrid + vue-data-tables 一起使用,结果改了两行 Egrid 的源码后二者完美一起使用(暂未发现 BUG),卧槽,这次真的要解放双手了

所以建议大家 egrid + vue-data-tables 一起组合使用~或者发起 PR 把 egrid 内置到 vue-data-tables 中

Expected Behavior

Current Behavior

Steps to Reproduce

Detailed Description

For feature request, provide the following section

Motivation / Use Case

Expected Behavior

Other Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions