feat: init

This commit is contained in:
陶林 2023-10-01 13:25:41 +08:00
parent e8729a499a
commit e01a2f5348
4 changed files with 10 additions and 19 deletions

View File

@ -26,6 +26,13 @@ export default defineConfig({
// 主题 // 主题
theme: { theme: {
'@primary-color': 'red', // '@primary-color': 'red',
},
// https://v3.umijs.org/zh-CN/plugins/plugin-layout
layout: {
name: 'Umi.js',
locale: true,
layout: 'side',
logo: '/user.jpg',
}, },
}); });

View File

@ -1,4 +1,4 @@
export default [ export default [
{ path: '/', component: '@/pages/index' }, { path: '/', component: '@/pages/index', name: '首页' },
{ path: '/about', component: '@/pages/about' }, { path: '/about', component: '@/pages/about', name: '关于' },
] ]

View File

@ -1,13 +0,0 @@
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>)
}

View File

@ -1,13 +1,10 @@
import styles from './index.less'; import styles from './index.less';
import { Button } from 'antd' import { Button } from 'antd'
import { BoxDiv } from '@/components/Box'
import { request } from 'umi'
export default function IndexPage() { export default function IndexPage() {
return ( return (
<div> <div>
<h1 className={styles.title}>Page index</h1> <h1 className={styles.title}>Page index</h1>
<Button type={"primary"}>Click</Button> <Button type={"primary"}>Click</Button>
<BoxDiv></BoxDiv>
</div> </div>
); );
} }