我正在使用https://phpspreadsheet.readthedocs.io/,我想在现有的XLSX文件中追加一行。由于阅读器和编写器类不同,看来我需要阅读整个表,进行几次export default function Cards() {
const classes = useStyles();
const classes2 = useStyles2();
const loadProducts = getAllProducts();
const products = useSelector(state => state.data.filteredProducts);
return (
<div className="App">
<Container maxWidth="md" className={classes.root}>
<Grid container md={4} spacing={1} ></Grid>
<Grid container md={8} spacing={1} alignItems={"center"}>
{products.map(product => (
<Grid item lg={4} md={4} sm={12} xs={12}>
<Card className={classes2.card}>
<CardMedia
className={classes2.media}
image={
"https://www.theclutch.com.br/wp-content/uploads/2019/11/skins-csgo-neymar.jpg"
}
/>
<CardContent className={classes2.content}>
<Typography
className={classes2.name}
variant={"h6"}
gutterBottom
>
{product.name}
</Typography>
<Typography
className={classes2.price}
variant={"h1"}
>
{util.formatCurrency(product.price)}
</Typography>
</CardContent>
</Card>
</Grid>
))}
</Grid>
</Container>
</div>
);
}
调用,然后再将整个shebang写回。这真的是唯一的吗?没有办法只是...要追加一行吗?
答案 0 :(得分:0)
我会使用$sheet->insertNewRowBefore($rowNumber, $count);