| | |
| | | }, |
| | | setup(props) { |
| | | function renderButton(action: ActionItem, index: number) { |
| | | const { disabled = false, label, icon, color = '', type = 'link' } = action; |
| | | const { disabled = false, label, icon, color = '', type = 'link', ...actionProps } = action; |
| | | const button = ( |
| | | <Button |
| | | type={type as any} |
| | | type={type} |
| | | size="small" |
| | | disabled={disabled} |
| | | color={color} |
| | | {...action} |
| | | {...actionProps} |
| | | key={`${index}-${label}`} |
| | | > |
| | | {() => ( |
| | | <> |
| | | {icon && <Icon icon={icon} class="mr-1" />} |
| | | {label} |
| | | {icon && <Icon icon={icon} />} |
| | | </> |
| | | )} |
| | | </Button> |
| | |
| | | return renderPopConfirm(action, index); |
| | | })} |
| | | {dropDownActions && dropDownActions.length && ( |
| | | <Dropdown> |
| | | <Dropdown overlayClassName="basic-tale-action-dropdown"> |
| | | {{ |
| | | default: dropdownDefaultSLot, |
| | | overlay: () => { |
| | |
| | | default: () => { |
| | | return dropDownActions.map((action, index) => { |
| | | const { disabled = false } = action; |
| | | action.ghost = true; |
| | | return ( |
| | | <Menu.Item key={`${index}`} disabled={disabled}> |
| | | {() => { |