diff --git a/config/config.ts b/config/config.ts index 886e748..46cf849 100644 --- a/config/config.ts +++ b/config/config.ts @@ -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', }, }); diff --git a/config/routes.ts b/config/routes.ts index e7ac9b0..09e9978 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -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: '关于' }, ] diff --git a/src/components/Box.tsx b/src/components/Box.tsx deleted file mode 100644 index 564c4ae..0000000 --- a/src/components/Box.tsx +++ /dev/null @@ -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 (
-

Box-{number}

- -
) -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index d429657..4a4c7c6 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -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 (

Page index

-
); }