grid-list不会成为可能的pull元素:
此行为正确吗?
以上示例中应用的代码:
import React from "react";
import PropTypes from "prop-types";
import { withStyles } from "@material-ui/core/styles";
import GridList from "@material-ui/core/GridList";
import GridListTile from "@material-ui/core/GridListTile";
const styles = theme => ({
root: {
display: "flex",
flexWrap: "wrap",
// justifyContent: "space-around",
overflow: "hidden"
},
gridList: {
flexWrap: "nowrap",
flex: 1,
transform: "translateZ(0)"
},
teste: {
width: 100,
background: "#ccc"
}
});
const SingleLineGridList = ({ classes }) => {
return (
<div className={classes.root}>
<GridList spacing={10} className={classes.gridList} cols={2.5}>
<GridListTile key={1} className={classes.teste}>
<div>aaa</div>
</GridListTile>
<GridListTile key={2} className={classes.teste}>
<div>bbbb</div>
</GridListTile>
<GridListTile key={3} className={classes.teste}>
<div>cccc</div>
</GridListTile>
<GridListTile key={4} className={classes.teste}>
<div>dddd</div>
</GridListTile>
</GridList>
</div>
);
};
SingleLineGridList.propTypes = {
classes: PropTypes.object.isRequired
};
export default withStyles(styles)(SingleLineGridList);
您可能会注意到,当该桌面拉动的界面不起作用时...请注意,当我将其放在移动界面上时,它就变得可拉动