diff --git a/examples/with-first-chunk-cache-ssr/src/components/Box/index.tsx b/examples/with-first-chunk-cache-ssr/src/components/Box/index.tsx index f33528d167..3acf3e52d1 100644 --- a/examples/with-first-chunk-cache-ssr/src/components/Box/index.tsx +++ b/examples/with-first-chunk-cache-ssr/src/components/Box/index.tsx @@ -44,8 +44,8 @@ async function getData() { ]; return [ - images[Math.round(Math.random() * images.length - 1)], - images[Math.round(Math.random() * images.length - 1)], - images[Math.round(Math.random() * images.length - 1)], + images[Math.floor(Math.random() * images.length)], + images[Math.floor(Math.random() * images.length)], + images[Math.floor(Math.random() * images.length)], ]; } \ No newline at end of file diff --git a/examples/with-first-chunk-cache-ssr/src/components/List/index.tsx b/examples/with-first-chunk-cache-ssr/src/components/List/index.tsx index e468c436c9..46e7136f8c 100644 --- a/examples/with-first-chunk-cache-ssr/src/components/List/index.tsx +++ b/examples/with-first-chunk-cache-ssr/src/components/List/index.tsx @@ -55,27 +55,27 @@ async function getData() { return [ { - logo: images[Math.round(Math.random() * images.length - 1)], + logo: images[Math.floor(Math.random() * images.length)], title: 'ice.js', description: '这是 ICE 框架', }, { - logo: images[Math.round(Math.random() * images.length - 1)], + logo: images[Math.floor(Math.random() * images.length)], title: 'ice.js', description: '这是 ICE 框架', }, { - logo: images[Math.round(Math.random() * images.length - 1)], + logo: images[Math.floor(Math.random() * images.length)], title: 'ice.js', description: '这是 ICE 框架', }, { - logo: images[Math.round(Math.random() * images.length - 1)], + logo: images[Math.floor(Math.random() * images.length)], title: 'ice.js', description: '这是 ICE 框架', }, { - logo: images[Math.round(Math.random() * images.length - 1)], + logo: images[Math.floor(Math.random() * images.length)], title: 'ice.js', description: '这是 ICE 框架', },