|
|
1 год назад | |
|---|---|---|
| public | 2 лет назад | |
| src | 1 год назад | |
| .gitignore | 2 лет назад | |
| README.md | 2 лет назад | |
| config-overrides.js | 2 лет назад | |
| package-lock.json | 2 лет назад | |
| package.json | 2 лет назад | |
| path.tsconfig.json | 2 лет назад | |
| tsconfig.json | 2 лет назад |
改动了部分源码。
接手项目请修改源码。
1.版本类型问题
找到 import { useDispatch } from "react-redux";
按住 Ctrl 点击 useDispatch 出来 useDispatch.d.ts类型声明文件 (路径node_modules>react-redux>es>hooks>useDispatch.d.ts)
找到最后面的 AnyAction,按住 Ctrl 点击 进入 (路径node_modules>redux>index.d.ts)
找到 export interface Action { type: T }
在type后面加一个 ? 即=>
export interface Action { type?: T }
2.添加了antd的 UploadFile 类型 声明
找到 const [fileList, setFileList] = useState([]);
按住 Ctrl 点击 UploadFile 进入 (路径node_modules>antd>es>upload>interface.d.ts)
在第 12 行 添加一个自定义类型声明:
type SelectType = {
id: number;
value: number | undefined;
txt: string;
tit: string;
fileName: string;
resName:string
};
export interface UploadFile extends ProgressAriaProps {
.....(上面自带的不用管,把 SelectType 加到最下面即可)
mySelect:SelectType
}
如果还不能解决请联系:邵根-18702025090