【发布时间】:2020-09-02 19:20:29
【问题描述】:
所以我有一个烦人的问题,我找不到结果。 我是 material-ui 的新手,感觉我在这里遗漏了一些东西......
我只想要网格项目之间的分隔线,而不会破坏网格的顺序。我错过了什么?
import React from "react";
import "./styles.css";
import {Grid, Typography, Divider} from '@material-ui/core'
export default function App() {
return (
<div className="App">
<Grid container spacing={3}>
<Grid item xs={4}>
<Typography variant="h5" component="h2">
One
</Typography>
</Grid>
<Grid item xs={4}>
<Typography variant="h5" component="h2">
Two
</Typography>
</Grid>
<Grid item xs={4}>
<Typography variant="h5" component="h2">
Three
</Typography>
</Grid>
</Grid>
<Grid container spacing={0} alignItems="center">
<Grid item xs={4}>
<Typography variant="h6" component="h2">
first value
</Typography>
</Grid>
<Divider orientation="vertical" flexItem/>
<Grid item xs={4}>
<Typography variant="h6" component="h2">
second value
</Typography>
</Grid>
<Divider orientation="vertical" flexItem/>
<Grid item xs={4}>
<Typography variant="h6" component="h2">
third value
</Typography>
</Grid>
</Grid>
</div>
);
}
【问题讨论】:
标签: reactjs material-ui