创建项目
npx create-react-app my-app
cd my-app
npm start
// 路由组件
import { Outlet } from "react-router-dom";
const [text, setText] = useState(value);
<Outlet context={[text, setText]} />;
// 子组件
import { useOutletContext } from "react-router-dom";
const [text, setText] = useOutletContext();
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)' }}>
<Item>1</Item>
<Item>2</Item>
<Item>3</Item>
</Box>
<Grid container spacing={2}>
<Grid item xs={8}>
<Item>xs=8</Item>
</Grid>
<Grid item xs={4}>
<Item>xs=4</Item>
</Grid>
<Grid item xs={4}>
<Item>xs=4</Item>
</Grid>
<Grid item xs={8}>
<Item>xs=8</Item>
</Grid>
</Grid>
<Stack spacing={2}>
<Item>Item 1</Item>
<Item>Item 2</Item>
<Item>Item 3</Item>
</Stack>
<DataGrid
columns={[{ field: "username" }, { field: "age" }]}
rows={[
{
id: 1,
username: "@MUI",
age: 20,
},
]}
/>
<Button variant="text">Text</Button>
<Button variant="contained">Contained</Button>
<Button variant="outlined">Outlined</Button>
<ButtonGroup variant="contained" aria-label="outlined primary button group">
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
<TextField id="outlined-basic" label="Outlined" variant="outlined" />
<TextField id="filled-basic" label="Filled" variant="filled" />
<TextField id="standard-basic" label="Standard" variant="standard" />
玉东数据是一家专注于互联网应用开发的企业,由从业多年的技术专家组成,在应用开发、网络运维等方面有广泛的经验和实力。
技术涵盖最新的 Web、小程序、Flutter、Android、iOS等多个领域的前沿技术。
商务合作,请微信扫码联系我: