Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
levy committed Nov 28, 2019
2 parents ac60ab5 + 4872ca0 commit 42e7180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/extra-buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default {
extraButtons: [
{
type: 'success',
disabled: row => row.date === '2016-05-04',
text: row => row.status === 'normal' ? '禁用' : '启用',
atClick(row) {
alert(row.name)
Expand Down
3 changes: 2 additions & 1 deletion src/el-data-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
:click="btn.atClick"
:params="scope.row"
:callback="getList"
:disabled="'disabled' in btn ? btn.disabled(scope.row) : false"
>
{{
typeof btn.text === 'function'
Expand Down Expand Up @@ -402,7 +403,7 @@ export default {
},
/**
* 操作列的自定义按钮, 渲染的是element-ui的button, 支持包括style在内的以下属性:
* {type: '', text: '', atClick: row => Promise.resolve(), show: row => return true时显示 }
* {type: '', text: '', atClick: row => Promise.resolve(), show: row => return true时显示, disabled: row => return true时禁用 }
* 点击事件 row参数 表示当前行数据, 需要返回Promise, 默认点击后会刷新table, resolve(false) 则不刷新
*/
extraButtons: {
Expand Down

0 comments on commit 42e7180

Please sign in to comment.