README.md 1.2 KB

改动了部分源码。

接手项目请修改源码。

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

3.插件问题 npm --registry https://registry.npmjs.org/ install react-file-viewer --force

4.蓝湖 地址:https://lanhuapp.com/link/#/invite?sid=qXnODvNa 密码:8Hn3