🐛 修复ts类型问题

This commit is contained in:
xujiang 2020-09-18 21:16:30 +08:00
parent 6034dc4fae
commit ee08a2333f

View File

@ -2,11 +2,11 @@ import { dynamic } from 'umi';
import Loading from '../LoadingCp'; import Loading from '../LoadingCp';
import { useMemo, memo, FC } from 'react'; import { useMemo, memo, FC } from 'react';
import React from 'react'; import React from 'react';
import { AllTemplateType } from './schema'; // import { AllTemplateType } from './schema';
export type componentsType = 'media' | 'base' | 'visible'; export type componentsType = 'media' | 'base' | 'visible';
const DynamicFunc = (type: AllTemplateType, componentsType: componentsType) => const DynamicFunc = (type: any, componentsType: componentsType) =>
dynamic({ dynamic({
loader: async function() { loader: async function() {
let Component: FC<{ isTpl: boolean }>; let Component: FC<{ isTpl: boolean }>;
@ -35,7 +35,7 @@ const DynamicFunc = (type: AllTemplateType, componentsType: componentsType) =>
type DynamicType = { type DynamicType = {
isTpl: boolean; isTpl: boolean;
config: { [key: string]: any }; config: { [key: string]: any };
type: AllTemplateType; type: any;
componentsType: componentsType; componentsType: componentsType;
category: componentsType; category: componentsType;
}; };