Compare commits
2 Commits
7-mock
...
9-antd-pro
Author | SHA1 | Date | |
---|---|---|---|
e01a2f5348 | |||
e8729a499a |
@@ -18,8 +18,21 @@ export default defineConfig({
|
||||
dynamicImport: {}, // 按需加载
|
||||
mountElementId: 'root', // 指定 reactapp 渲染到元素的根元素 id
|
||||
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'https://127.0.0.1:8989'
|
||||
},
|
||||
},
|
||||
|
||||
// 主题
|
||||
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,12 +1,10 @@
|
||||
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