Commit de499a145556427304abe075b62e6869f44dc640
1 parent
49827866
fix: fix the display problem of table icon
Showing
6 changed files
with
21 additions
and
13 deletions
CHANGELOG.zh_CN.md
@@ -26,10 +26,11 @@ | @@ -26,10 +26,11 @@ | ||
26 | 26 | ||
27 | ### 🐛 Bug Fixes | 27 | ### 🐛 Bug Fixes |
28 | 28 | ||
29 | -- 修复 tree 文本超出挡住操作按钮问题 | ||
30 | -- 修复通过 useRedo 刷新页面参数丢失问题 | ||
31 | -- 修复表单校验先设置在校验及控制台错误信息问题 | ||
32 | -- 修复`modal`与`drawer`组件传递数组参数问题 | 29 | +- tree: 修复文本超出挡住操作按钮问题 |
30 | +- useRedo: 修复通过 useRedo 刷新页面参数丢失问题 | ||
31 | +- form: 修复表单校验先设置在校验及控制台错误信息问题 | ||
32 | +- `modal`&`drawer` 修复组件传递数组参数问题 | ||
33 | +- form: 修复`updateSchema`赋值含有`[]`时不生效 | ||
33 | 34 | ||
34 | ### 🎫 Chores | 35 | ### 🎫 Chores |
35 | 36 |
src/components/Table/src/components/TableAction.tsx
@@ -24,20 +24,20 @@ export default defineComponent({ | @@ -24,20 +24,20 @@ export default defineComponent({ | ||
24 | }, | 24 | }, |
25 | setup(props) { | 25 | setup(props) { |
26 | function renderButton(action: ActionItem, index: number) { | 26 | function renderButton(action: ActionItem, index: number) { |
27 | - const { disabled = false, label, icon, color = '', type = 'link' } = action; | 27 | + const { disabled = false, label, icon, color = '', type = 'link', ...actionProps } = action; |
28 | const button = ( | 28 | const button = ( |
29 | <Button | 29 | <Button |
30 | - type={type as any} | 30 | + type={type} |
31 | size="small" | 31 | size="small" |
32 | disabled={disabled} | 32 | disabled={disabled} |
33 | color={color} | 33 | color={color} |
34 | - {...action} | 34 | + {...actionProps} |
35 | key={`${index}-${label}`} | 35 | key={`${index}-${label}`} |
36 | > | 36 | > |
37 | {() => ( | 37 | {() => ( |
38 | <> | 38 | <> |
39 | + {icon && <Icon icon={icon} class="mr-1" />} | ||
39 | {label} | 40 | {label} |
40 | - {icon && <Icon icon={icon} />} | ||
41 | </> | 41 | </> |
42 | )} | 42 | )} |
43 | </Button> | 43 | </Button> |
@@ -96,7 +96,7 @@ export default defineComponent({ | @@ -96,7 +96,7 @@ export default defineComponent({ | ||
96 | return renderPopConfirm(action, index); | 96 | return renderPopConfirm(action, index); |
97 | })} | 97 | })} |
98 | {dropDownActions && dropDownActions.length && ( | 98 | {dropDownActions && dropDownActions.length && ( |
99 | - <Dropdown> | 99 | + <Dropdown overlayClassName="basic-tale-action-dropdown"> |
100 | {{ | 100 | {{ |
101 | default: dropdownDefaultSLot, | 101 | default: dropdownDefaultSLot, |
102 | overlay: () => { | 102 | overlay: () => { |
@@ -106,6 +106,7 @@ export default defineComponent({ | @@ -106,6 +106,7 @@ export default defineComponent({ | ||
106 | default: () => { | 106 | default: () => { |
107 | return dropDownActions.map((action, index) => { | 107 | return dropDownActions.map((action, index) => { |
108 | const { disabled = false } = action; | 108 | const { disabled = false } = action; |
109 | + action.ghost = true; | ||
109 | return ( | 110 | return ( |
110 | <Menu.Item key={`${index}`} disabled={disabled}> | 111 | <Menu.Item key={`${index}`} disabled={disabled}> |
111 | {() => { | 112 | {() => { |
src/components/Table/src/style/index.less
src/components/Table/src/types/tableAction.ts
1 | -export interface ActionItem { | 1 | +import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; |
2 | +export interface ActionItem extends ButtonProps { | ||
2 | onClick?: any; | 3 | onClick?: any; |
3 | label: string; | 4 | label: string; |
4 | - disabled?: boolean; | ||
5 | color?: 'success' | 'error' | 'warning'; | 5 | color?: 'success' | 'error' | 'warning'; |
6 | - type?: string; | ||
7 | - props?: any; | ||
8 | icon?: string; | 6 | icon?: string; |
9 | popConfirm?: PopConfirm; | 7 | popConfirm?: PopConfirm; |
10 | } | 8 | } |
src/components/registerGlobComp.ts
@@ -32,6 +32,7 @@ import { | @@ -32,6 +32,7 @@ import { | ||
32 | Result, | 32 | Result, |
33 | Empty, | 33 | Empty, |
34 | Avatar, | 34 | Avatar, |
35 | + Menu, | ||
35 | } from 'ant-design-vue'; | 36 | } from 'ant-design-vue'; |
36 | import { getApp } from '/@/setup/App'; | 37 | import { getApp } from '/@/setup/App'; |
37 | 38 | ||
@@ -78,5 +79,6 @@ export function registerGlobComp() { | @@ -78,5 +79,6 @@ export function registerGlobComp() { | ||
78 | .use(Result) | 79 | .use(Result) |
79 | .use(Empty) | 80 | .use(Empty) |
80 | .use(Avatar) | 81 | .use(Avatar) |
82 | + .use(Menu) | ||
81 | .use(Tabs); | 83 | .use(Tabs); |
82 | } | 84 | } |
src/views/demo/table/FixedColumn.vue