mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 15:41:32 +08:00
fix: fix the display problem of table icon
This commit is contained in:
@@ -24,20 +24,20 @@ export default defineComponent({
|
||||
},
|
||||
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>
|
||||
@@ -96,7 +96,7 @@ export default defineComponent({
|
||||
return renderPopConfirm(action, index);
|
||||
})}
|
||||
{dropDownActions && dropDownActions.length && (
|
||||
<Dropdown>
|
||||
<Dropdown overlayClassName="basic-tale-action-dropdown">
|
||||
{{
|
||||
default: dropdownDefaultSLot,
|
||||
overlay: () => {
|
||||
@@ -106,6 +106,7 @@ export default defineComponent({
|
||||
default: () => {
|
||||
return dropDownActions.map((action, index) => {
|
||||
const { disabled = false } = action;
|
||||
action.ghost = true;
|
||||
return (
|
||||
<Menu.Item key={`${index}`} disabled={disabled}>
|
||||
{() => {
|
||||
|
@@ -24,6 +24,11 @@
|
||||
|
||||
&-action {
|
||||
display: flex;
|
||||
|
||||
button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
&-toolbar {
|
||||
|
@@ -1,10 +1,8 @@
|
||||
export interface ActionItem {
|
||||
import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
|
||||
export interface ActionItem extends ButtonProps {
|
||||
onClick?: any;
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
color?: 'success' | 'error' | 'warning';
|
||||
type?: string;
|
||||
props?: any;
|
||||
icon?: string;
|
||||
popConfirm?: PopConfirm;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ import {
|
||||
Result,
|
||||
Empty,
|
||||
Avatar,
|
||||
Menu,
|
||||
} from 'ant-design-vue';
|
||||
import { getApp } from '/@/setup/App';
|
||||
|
||||
@@ -78,5 +79,6 @@ export function registerGlobComp() {
|
||||
.use(Result)
|
||||
.use(Empty)
|
||||
.use(Avatar)
|
||||
.use(Menu)
|
||||
.use(Tabs);
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@
|
||||
:actions="[
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'ant-design:area-chart-outlined',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
]"
|
||||
|
Reference in New Issue
Block a user