feat: init
This commit is contained in:
parent
e8729a499a
commit
e01a2f5348
@ -26,6 +26,13 @@ export default defineConfig({
|
||||
|
||||
// 主题
|
||||
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',
|
||||
},
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default [
|
||||
{ path: '/', component: '@/pages/index' },
|
||||
{ path: '/about', component: '@/pages/about' },
|
||||
{ path: '/', component: '@/pages/index', name: '首页' },
|
||||
{ path: '/about', component: '@/pages/about', name: '关于' },
|
||||
]
|
||||
|
@ -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>)
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
import styles from './index.less';
|
||||
import { Button } from 'antd'
|
||||
import { BoxDiv } from '@/components/Box'
|
||||
import { request } from 'umi'
|
||||
export default function IndexPage() {
|
||||
return (
|
||||
<div>
|
||||
<h1 className={styles.title}>Page index</h1>
|
||||
<Button type={"primary"}>Click</Button>
|
||||
<BoxDiv></BoxDiv>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user