1234567891011121314151617181920212223242526272829303132333435 |
- import styles from './index.less';
- import { Layout, Menu } from 'antd';
- import { useState } from 'react';
- const { SubMenu } = Menu;
- const { Header, Content, Sider } = Layout;
- export default function IndexPage() {
- const [value, setValue] = useState(0);
- const complexIncrease = () => {
- setTimeout(() => {
- setValue(value + 1)
- },0)
- }
- return (
- <>
- <section>
- <h2>计数器</h2>
- <h3>{value}</h3>
- <button>-</button>
- <button onClick={() => setValue(value+1)}>+</button>
- </section>
- <section>
- <h2>计数器</h2>
- <h3>{value}</h3>
- <button onClick={complexIncrease}>延迟</button>
- </section>
- </>
- // <Layout>
- // <span>home</span>
-
- // </Layout>
- );
- }
|