
环境
Ant Design of React官网:https://ant.design/docs/react/introduce-cn
一、创建项目
打开package.json,参考以下各模块版本:
下载后进入到项目文件夹,安装package.json中的包:
尝试更改package.json启动命令:
二、项目目录初始化
删除掉官方自带而对我们暂时帮助不大的文件。
删除src下除了main.tsxs和App.tsx的其他文件;
主文件/src/main.tsx修改成:
node:
16.17.1
npm:
8.15.0
npm init vite
Project name: lege-management
Select a framework: react
Select a variant: react-ts
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^7.2.8",
"react-router-dom": "^6.3.0",
"redux": "^4.1.2"
},
npm i
"scripts": {
"dev": "vite --host --port 3002",
"build": "tsc && vite build",
"preview": "vite preview"
}