feat: init
This commit is contained in:
parent
653fc7b09d
commit
b051c59e9e
13
src/components/Box.tsx
Normal file
13
src/components/Box.tsx
Normal 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>)
|
||||||
|
}
|
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user