chore: 消除Switch组件类型错误。close #3111

This commit is contained in:
invalid w 2023-10-09 11:26:48 +08:00
parent e53fefb310
commit 49d40d685d

View File

@ -4,6 +4,7 @@ import { Switch } from 'ant-design-vue';
import { setRoleStatus } from '/@/api/demo/system';
import { useMessage } from '/@/hooks/web/useMessage';
type CheckedType = boolean | string | number;
export const columns: BasicColumn[] = [
{
title: '角色名称',
@ -33,7 +34,7 @@ export const columns: BasicColumn[] = [
checkedChildren: '停用',
unCheckedChildren: '启用',
loading: record.pendingStatus,
onChange(checked: boolean) {
onChange(checked: CheckedType) {
record.pendingStatus = true;
const newStatus = checked ? '1' : '0';
const { createMessage } = useMessage();