feat: init

This commit is contained in:
陶林 2023-10-01 01:26:04 +08:00
parent 653fc7b09d
commit b051c59e9e
3 changed files with 15 additions and 5 deletions

View File

@ -1,5 +0,0 @@
# 默认全局
src/global.less

13
src/components/Box.tsx Normal file
View 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>)
}

View File

@ -1,10 +1,12 @@
import styles from './index.less'; import styles from './index.less';
import { Button } from 'antd' import { Button } from 'antd'
import { BoxDiv } from '@/components/Box'
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>
); );
} }