zoukankan      html  css  js  c++  java
  • vue+elementUI 表头按钮

    要实现下图,表头

    方法1:

    <el-table-column  label="操作" :render-header="renderHeaderCaseBody"></el-table-column>
                 renderHeaderCaseBody(h, params) {
            let a =  [
                        h('el-button-group',[
                            // 文字提示
                            h('el-tooltip',{
                                props: {
                                    disabled: false,
                                    content: "批量编辑",
                                    placement: "bottom",
                                    effect: "light"
                                },
                            },
                            [
                                // 批量编辑
                                h('el-button', {
                                    props: {
                                        size: "mini",
                                        type: "primary",
                                        icon: "el-icon-s-flag"
                                    },
                                    on: {
                                        click: () => {
                        this.isbodyTextAreaShow = true;
                        this.isBodyTabShowTable = false;
                        this.addCaseData.isbodyTextAreaButton = true;
                        this.resetValParamTextArea(this.bodyTableData, 2);
                                        }
                                    }
                                }, "Bulk Edit")
                            ]),
                        ])
                    ]
            return h('div', a);
          },

    但是以上console控制台会有一个警告:使用scoped-slot比用render-header更简单

    [Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.这

    这个可以通过方法2解决。

    方法2:

    <el-table-column label="操作" scoped-slot>
      <template slot="header">
          <el-button-group>
              <el-tooltip :disabled="false" placement="bottom" effect="light">批量编辑</el-tooltip>
              <el-button size="mini" type="primary" icon="el-icon-s-flag" @click="BodyBulkEditClick">Bulk Edit</el-button>
          </el-button-group>
      </template>
    <template slot-scope="scope"> <el-link type="info" :underline="false" icon="el-icon-close" @click.native="deleteRow(3, scope.$index, scope.row)" circle></el-link> </template> </el-table-column>

    这样就实现了,方法1的效果。

  • 相关阅读:
    php单引号和双引号
    转CSS技巧大全
    在C#中实现打印功能(C#中PrintDialog,PrintDocument的使用) (转)
    从安装到使用Ubuntu遇到问题解决问题一览
    原型模型
    PHP源代码分析 tick(s)
    在DOS下修改windows 登入密码 转载
    配置php5.3.6+Apache2.2
    Java多线程全源码分析
    本笨鸟今天开始学习.net,有木有一起开始学的
  • 原文地址:https://www.cnblogs.com/yhleng/p/13183234.html
Copyright © 2011-2022 走看看