Commit 0f28e803d0b65537216cd9f40ad5cad63c20db9b
1 parent
cad021c3
fix(table-action): incorrect button color of `disabled` state
修复表格操作列的按钮在disabled状态下的颜色显示 fixed: #891
Showing
2 changed files
with
6 additions
and
4 deletions
CHANGELOG.zh_CN.md
src/components/Button/src/PopConfirmButton.vue
1 | 1 | <script lang="ts"> |
2 | - import { defineComponent, h, unref, computed } from 'vue'; | |
2 | + import { computed, defineComponent, h, unref } from 'vue'; | |
3 | 3 | import BasicButton from './BasicButton.vue'; |
4 | 4 | import { Popconfirm } from 'ant-design-vue'; |
5 | 5 | import { extendSlots } from '/@/utils/helper/tsxHelper'; |
... | ... | @@ -29,19 +29,20 @@ |
29 | 29 | |
30 | 30 | // get inherit binding value |
31 | 31 | const getBindValues = computed(() => { |
32 | - const popValues = Object.assign( | |
32 | + return Object.assign( | |
33 | 33 | { |
34 | 34 | okText: t('common.okText'), |
35 | 35 | cancelText: t('common.cancelText'), |
36 | 36 | }, |
37 | 37 | { ...props, ...unref(attrs) } |
38 | 38 | ); |
39 | - return popValues; | |
40 | 39 | }); |
41 | 40 | |
42 | 41 | return () => { |
43 | 42 | const bindValues = omit(unref(getBindValues), 'icon'); |
44 | - const Button = h(BasicButton, omit(bindValues, 'title'), extendSlots(slots)); | |
43 | + const btnBind = omit(bindValues, 'title'); | |
44 | + if (btnBind.disabled) btnBind.color = ''; | |
45 | + const Button = h(BasicButton, btnBind, extendSlots(slots)); | |
45 | 46 | |
46 | 47 | // If it is not enabled, it is a normal button |
47 | 48 | if (!props.enable) { | ... | ... |