chore: array fill (#8263)

This commit is contained in:
neverland
2021-03-04 14:04:47 +08:00
committed by GitHub
parent 12be46fad8
commit 3fd2972b7c
6 changed files with 19 additions and 36 deletions
+5 -10
View File
@@ -73,17 +73,12 @@ export default createComponent({
return rowWidth;
};
const renderRows = () => {
const Rows: JSX.Element[] = [];
for (let i = 0; i < props.row; i++) {
Rows.push(
const renderRows = () =>
Array(props.row)
.fill('')
.map((_, i) => (
<div class={bem('row')} style={{ width: addUnit(getRowWidth(i)) }} />
);
}
return Rows;
};
));
return () => {
if (!props.loading) {