Skip to content

Commit

Permalink
fix(table-action): incorrect button color of disabled state
Browse files Browse the repository at this point in the history
修复表格操作列的按钮在disabled状态下的颜色显示

fixed: #891
  • Loading branch information
mynetfan committed Jul 12, 2021
1 parent cad021c commit 0f28e80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- 修复滚动条样式问题
- 修复树形表格的带有展开图标的单元格的内容对齐问题
- 新增`headerTop`插槽
- 修复操作列的按钮在 disabled 状态下的颜色显示
- **AppSearch** 修复可能会搜索隐藏菜单的问题
- **TableAction** 仅在 action.tooltip 存在的情况下 才包裹 Tooltip 组件
- **BasicUpload** 修复处理非`array`值时报错的问题
Expand Down
9 changes: 5 additions & 4 deletions src/components/Button/src/PopConfirmButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent, h, unref, computed } from 'vue';
import { computed, defineComponent, h, unref } from 'vue';
import BasicButton from './BasicButton.vue';
import { Popconfirm } from 'ant-design-vue';
import { extendSlots } from '/@/utils/helper/tsxHelper';
Expand Down Expand Up @@ -29,19 +29,20 @@
// get inherit binding value
const getBindValues = computed(() => {
const popValues = Object.assign(
return Object.assign(
{
okText: t('common.okText'),
cancelText: t('common.cancelText'),
},
{ ...props, ...unref(attrs) }
);
return popValues;
});
return () => {
const bindValues = omit(unref(getBindValues), 'icon');
const Button = h(BasicButton, omit(bindValues, 'title'), extendSlots(slots));
const btnBind = omit(bindValues, 'title');
if (btnBind.disabled) btnBind.color = '';
const Button = h(BasicButton, btnBind, extendSlots(slots));
// If it is not enabled, it is a normal button
if (!props.enable) {
Expand Down

0 comments on commit 0f28e80

Please sign in to comment.