Skip to content

Commit

Permalink
fix: optimize demo writing
Browse files Browse the repository at this point in the history
  • Loading branch information
irisSong committed Nov 21, 2024
1 parent 3b33363 commit 2dfed2b
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo1 = () => {
return (
<Grid>
{[...Array(8)].map((_, index) => (
{Array.from({ length: 8 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo10.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Demo10 = () => {
}
return (
<Grid direction="horizontal" onClick={onClick}>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo2 = () => {
return (
<Grid columns={3} gap={7}>
{[...Array(6)].map((_, index) => (
{Array.from({ length: 6 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Demo3 = () => {
'--nutui-grid-border-width': '1px',
}}
>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo4 = () => {
return (
<Grid gap={3}>
{[...Array(8)].map((_, index) => (
{Array.from({ length: 8 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo5 = () => {
return (
<Grid reverse>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo6 = () => {
return (
<Grid direction="horizontal">
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react'
const Demo7 = () => {
return (
<Grid reverse direction="horizontal">
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/h5/demo9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Demo9 = () => {
'https://m.360buyimg.com/babel/jfs/t1/36973/29/11270/120042/5cf1fe3cEac2b5898/10c2722d0cc0bfa7.png'
return (
<Grid>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index}>
<Image src={imgSrc} width="100%" height="100%" />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react-taro'
const Demo1 = () => {
return (
<Grid>
{[...Array(8)].map((_, index) => (
{Array.from({ length: 8 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo10.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Demo10 = () => {
}
return (
<Grid direction="horizontal" onClick={onClick}>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react-taro'
const Demo2 = () => {
return (
<Grid columns={3} gap={7}>
{[...Array(6)].map((_, index) => (
{Array.from({ length: 6 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Demo3 = () => {
'--nutui-grid-border-width': '1px',
}}
>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react-taro'
const Demo4 = () => {
return (
<Grid gap={3}>
{[...Array(8)].map((_, index) => (
{Array.from({ length: 8 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Demo5 = () => {
const style = { height: pxTransform(100) }
return (
<Grid reverse style={style}>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react-taro'
const Demo6 = () => {
return (
<Grid direction="horizontal">
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Image } from '@nutui/icons-react-taro'
const Demo7 = () => {
return (
<Grid reverse direction="horizontal">
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index} text="文字">
<Image />
</Grid.Item>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/grid/demos/taro/demo9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Demo9 = () => {
'https://m.360buyimg.com/babel/jfs/t1/36973/29/11270/120042/5cf1fe3cEac2b5898/10c2722d0cc0bfa7.png'
return (
<Grid>
{[...Array(4)].map((_, index) => (
{Array.from({ length: 4 }, (_, index) => (
<Grid.Item key={index}>
<Image src={imgSrc} style={style} />
</Grid.Item>
Expand Down

0 comments on commit 2dfed2b

Please sign in to comment.