fix: 修复ts类型错误

This commit is contained in:
ganpeng
2022-06-01 13:54:32 +08:00
parent 363ed7ae9e
commit f20f4209a3
9 changed files with 14 additions and 10 deletions

View File

@@ -75,7 +75,7 @@
const getDropdownList = computed(() => {
return (toRaw(props.dropDownActions) || [])
.filter((action) => {
return hasPermission(action.auth) && isIfShow(action);
return hasPermission(action.auth as string[]) && isIfShow(action);
})
.map((action) => {
const { popConfirm } = action;
@@ -108,7 +108,7 @@
const getActions = computed(() => {
return (toRaw(props.actions) || [])
.filter((action) => {
return hasPermission(action.auth) && isIfShow(action);
return hasPermission(action.auth as string[]) && isIfShow(action);
})
.map((action) => {
const { popConfirm } = action;

View File

@@ -34,4 +34,5 @@ export interface BasicTableProps {
actionColumn: any[];
canResize: boolean;
resizeHeightOffset: number;
loading: boolean;
}

View File

@@ -1,6 +1,6 @@
import { NButton } from 'naive-ui';
import { PermissionsEnum } from '@/enums/permissionsEnum';
export interface ActionItem extends NButton.props {
export interface ActionItem extends Partial<InstanceType<typeof NButton>> {
onClick?: Fn;
label?: string;
color?: 'success' | 'error' | 'warning';