我希望容器方向为 md 尺寸屏幕上方的“行”和 md 尺寸屏幕下方的“列”?我该如何实施?
<Grid container direction = "row"(in large screens)/direction = "column"(in small screens)>
Run Code Online (Sandbox Code Playgroud)
我尝试过这个。
<Grid container classes={gridDirection}>
gridDirection: {
direction = "row",
[theme.breakpoints.down('md')]: {
direction = "column",
},
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用可能是因为“direction”是一个react prop而不是CSS样式。有没有办法访问样式表文件中的这些反应道具?
params 对象似乎不适用于 InputBase。我也试过 ref={params.inputProps}。我正在使用 googleplaces 自动完成功能
<Autocomplete
id="combo-box-demo"
options={autocomplete}
style={{ width: 300 }}
renderInput={(params) => <TextField {...params} />} // InputBase instead of TextField
/>
Run Code Online (Sandbox Code Playgroud)