Compare commits
	
		
			6 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b15f09c27c | |||
| b051c59e9e | |||
| 653fc7b09d | |||
| 620154793b | |||
| e9557c1ef3 | |||
| 2e2518e1d5 | 
							
								
								
									
										6
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="VcsDirectoryMappings">
 | 
			
		||||
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										14
									
								
								.umirc.ts
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								.umirc.ts
									
									
									
									
									
								
							@@ -1,14 +0,0 @@
 | 
			
		||||
import { defineConfig } from 'umi';
 | 
			
		||||
 | 
			
		||||
export default defineConfig({
 | 
			
		||||
  nodeModulesTransform: {
 | 
			
		||||
    type: 'none',
 | 
			
		||||
  },
 | 
			
		||||
  routes: [
 | 
			
		||||
    { path: '/', component: '@/pages/index' },
 | 
			
		||||
  ],
 | 
			
		||||
  fastRefresh: {},
 | 
			
		||||
  history: {
 | 
			
		||||
    type: 'hash'
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										15
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README.md
									
									
									
									
									
								
							@@ -1,15 +0,0 @@
 | 
			
		||||
# umi project
 | 
			
		||||
 | 
			
		||||
## Getting Started
 | 
			
		||||
 | 
			
		||||
Install dependencies,
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
$ yarn
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Start the dev server,
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
$ yarn start
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								config/config.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								config/config.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
import { defineConfig } from 'umi';
 | 
			
		||||
import routes from './routes'
 | 
			
		||||
export default defineConfig({
 | 
			
		||||
  nodeModulesTransform: {
 | 
			
		||||
    type: 'none', // all 慢 兼容好
 | 
			
		||||
  },
 | 
			
		||||
  routes,
 | 
			
		||||
  fastRefresh: {},
 | 
			
		||||
  history: {
 | 
			
		||||
    type: 'browser'
 | 
			
		||||
  },
 | 
			
		||||
  // 后续设置的配置
 | 
			
		||||
  devServer: {
 | 
			
		||||
    port: 3000, // 启动端口
 | 
			
		||||
  },
 | 
			
		||||
  title: 'UmiV3',// 网站标题
 | 
			
		||||
  favicon: '/favicon.ico',// 网站图标
 | 
			
		||||
  dynamicImport: {}, // 按需加载
 | 
			
		||||
  mountElementId: 'root', // 指定 reactapp 渲染到元素的根元素 id
 | 
			
		||||
 | 
			
		||||
  // 主题
 | 
			
		||||
  theme: {
 | 
			
		||||
    '@primary-color': 'red',
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										4
									
								
								config/routes.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								config/routes.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
export default [
 | 
			
		||||
  { path: '/', component: '@/pages/index' },
 | 
			
		||||
  { path: '/about', component: '@/pages/about' },
 | 
			
		||||
]
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/react": "^17.0.0",
 | 
			
		||||
    "@types/react-dom": "^17.0.0",
 | 
			
		||||
    "@umijs/preset-react": "1.x",
 | 
			
		||||
    "@umijs/preset-react": "latest",
 | 
			
		||||
    "@umijs/test": "^3.5.41",
 | 
			
		||||
    "lint-staged": "^10.0.7",
 | 
			
		||||
    "prettier": "^2.2.0",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								public/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 216 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/user.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/user.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/assets/user.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/user.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										13
									
								
								src/components/Box.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/components/Box.tsx
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
import {useState} from "react";
 | 
			
		||||
import { Button } from 'antd'
 | 
			
		||||
export function  BoxDiv(){
 | 
			
		||||
  let [number, setNumber] = useState(0)
 | 
			
		||||
  function clickHandler(){
 | 
			
		||||
    setNumber(number+1);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return (<div>
 | 
			
		||||
    <h1>Box-{number}</h1>
 | 
			
		||||
    <Button onClick={ clickHandler }>+</Button>
 | 
			
		||||
  </div>)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										4
									
								
								src/global.less
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/global.less
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
body, html {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  min-height: 100vh;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								src/pages/document.ejs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/pages/document.ejs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
 | 
			
		||||
    <link rel="stylesheet" href="/umi.css" />
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<div id="root"></div>
 | 
			
		||||
<script src="/umi.js"></script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -1,9 +1,12 @@
 | 
			
		||||
import styles from './index.less';
 | 
			
		||||
 | 
			
		||||
import { Button } from 'antd'
 | 
			
		||||
import { BoxDiv } from '@/components/Box'
 | 
			
		||||
export default function IndexPage() {
 | 
			
		||||
  return (
 | 
			
		||||
    <div>
 | 
			
		||||
      <h1 className={styles.title}>Page index</h1>
 | 
			
		||||
      <Button type={"primary"}>Click</Button>
 | 
			
		||||
      <BoxDiv></BoxDiv>
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user