njleonzhang / vue-data-tables

A simple, customizable and pageable table with SSR support, based on vue2 and element-ui
https://njleonzhang.github.io/vue-data-tables
MIT License
1.02k stars 221 forks source link

希望需求:动作列 buttons 添加 visible 属性 #216

Closed zaxlct closed 5 years ago

zaxlct commented 5 years ago

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

For bug report, provide the following section

buttons: [ 
    {
      handler?: (row) => void;   // 点击事件的 callback, 注意使用箭头函数,
      visible?: (row) => Boolean; // 类似 v-if 的功能
      label: String;             // 按钮的 label
    },
    ...
  ]

Online reproduce

It is important to provide an online sample to reproduce the issue.

Expected Behavior

Current Behavior

Steps to Reproduce

Detailed Description

For feature request, provide the following section

Motivation / Use Case

Expected Behavior

Other Information

njleonzhang commented 5 years ago

https://www.njleonzhang.com/vue-data-tables/#/zh-cn/actionCol?id=%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90%E5%8A%A8%E4%BD%9C%E5%88%97

参照文档和例子,使用 props 属性可以实现。