目前,我正在尝试自定义元素的样式,但我们可以从这里开始。我似乎无法makeStyles
正常使用,不确定是因为有嵌套组件还是什么。无法正常工作的线路是<TableHead className={classes.top_row}>
。我试过同时使用@material-ui/styles
和@material-ui/core
makeStyles
功能,但无济于事。
'''
import { makeStyles} from '@material-ui/core';
const useStyles = makeStyles((theme) =>({
table: {
width: "100%",
},
createServiceButton:{
width: "170px",
height: "50px",
},
top_row:{
color: '#E1C699',
fontWeight: 550,
fontFamily:'Times New Roman'
},
}));
export default function ShowServiceList() {
const classes = useStyles();
return(<TableContainer component={Paper}>
<Table aria-label="simple table">
<TableHead className={classes.top_row}>
<TableRow>
<TableCell>Subject</TableCell>
<TableCell align="right">Description</TableCell>
<TableCell align="right">Technology</TableCell>
<TableCell align="right">OS</TableCell>
<TableCell align="right">Posted By</TableCell>
</TableRow>
</TableHead>
<TableBody>
{!filterIsActive
? serviceList.map((service) => (
<Service service={service} key={service.service_id} />
))
: filterServices()}
</TableBody>
</Table>
</TableContainer>
);
}
'''
附带问题,在 React-Node 应用程序中,依赖关系是否安装在节点或 React 的 package.json 中是否重要?