Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(grid): update icon #2710

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Nov 8, 2024

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 新功能

    • 在多个示例组件中引入了来自 @nutui/icons-react-taro 包的 Image 组件,替换了本地定义的 Image 组件。
    • 示例组件现在使用 Image 组件替代了之前的 Text 组件,提升了图像展示效果。
  • bug 修复

    • 移除了未使用的本地 Image 组件定义,确保代码整洁。

Copy link

coderabbitai bot commented Nov 8, 2024

Walkthrough

此次变更主要涉及 src/packages/grid/demos/taro 目录下多个演示文件的导入语句修改。所有文件中本地定义的 Image 组件均被移除,并替换为从 @nutui/icons-react-taro 包中导入的 Image 组件。尽管组件的结构和功能保持不变,但渲染的实现由本地组件转变为导入组件。

Changes

文件路径 变更摘要
src/packages/grid/demos/taro/demo1.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo2.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo3.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo4.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo5.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo6.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo7.tsx 移除本地定义的 Image 组件,添加从 @nutui/icons-react-taro 导入的 Image 组件。
src/packages/grid/demos/taro/demo8.tsx Text 组件替换为从 @nutui/icons-react-taro 导入的 Image 组件。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Demo
    participant ImageComponent

    User->>Demo: 触发渲染
    Demo->>ImageComponent: 使用导入的 Image 组件
    ImageComponent-->>Demo: 返回图像
    Demo-->>User: 显示图像
Loading

Suggested labels

size/XL

Poem

在草地上跳跃的小兔子,
新图像替代了旧的文字,
每个格子里都是新风景,
让我们欢庆这次变更,
兔子们欢呼,乐在其中! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.95%. Comparing base (16b173e) to head (9199a29).
Report is 3 commits behind head on V3.0.

Additional details and impacted files
@@           Coverage Diff           @@
##             V3.0    #2710   +/-   ##
=======================================
  Coverage   83.95%   83.95%           
=======================================
  Files         221      221           
  Lines       17842    17842           
  Branches     2675     2675           
=======================================
  Hits        14980    14980           
  Misses       2857     2857           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (6)
src/packages/grid/demos/taro/demo3.tsx (1)

Line range hint 9-17: 建议添加 Image 组件的属性说明

为了提高代码的可维护性和文档的完整性,建议在 Image 组件上添加必要的属性说明,例如大小、颜色等配置项。这样可以让其他开发者更容易理解和使用这个组件。

示例修改:

      <Grid.Item text="文字">
-        <Image />
+        <Image name="image-name" size={20} />
      </Grid.Item>
src/packages/grid/demos/taro/demo6.tsx (1)

Line range hint 1-22: 建议优化组件的可访问性

虽然组件结构正确,但建议考虑以下改进:

  1. Image 组件添加 alt 属性以提高可访问性
  2. 考虑为重复的文本内容使用更有意义的描述

建议按如下方式修改:

 <Grid direction="horizontal">
-      <Grid.Item text="文字">
-        <Image />
+      <Grid.Item text="选项一">
+        <Image alt="选项一图标" />
       </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
+      <Grid.Item text="选项二">
+        <Image alt="选项二图标" />
       </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
+      <Grid.Item text="选项三">
+        <Image alt="选项三图标" />
       </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
+      <Grid.Item text="选项四">
+        <Image alt="选项四图标" />
       </Grid.Item>
src/packages/grid/demos/taro/demo5.tsx (1)

Line range hint 10-21: 建议优化重复代码结构

当前代码中有四个完全相同的 Grid.Item 结构。建议通过数组映射来简化代码:

-    <Grid reverse style={style}>
-      <Grid.Item text="文字">
-        <Image />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image />
-      </Grid.Item>
-    </Grid>
+    <Grid reverse style={style}>
+      {Array(4).fill(null).map((_, index) => (
+        <Grid.Item key={index} text="文字">
+          <Image />
+        </Grid.Item>
+      ))}
+    </Grid>
src/packages/grid/demos/taro/demo10.tsx (1)

Line range hint 11-25: 组件结构合理,建议增加类型定义

Grid 组件的结构清晰,但有以下建议:

  1. onClick 处理函数的 item 参数使用 any 类型,建议定义具体的接口类型
  2. Image 组件的使用方式统一,符合预期

建议添加以下类型定义:

interface GridItem {
  text: string;
  // 根据实际业务需求添加其他属性
}

然后更新 onClick 的类型:

- const onClick = (item: any, index: number) => {
+ const onClick = (item: GridItem, index: number) => {
src/packages/grid/demos/taro/demo1.tsx (1)

Line range hint 8-31: 建议优化重复的代码结构

当前代码中有8个完全相同的 Grid.Item 结构,建议通过数组映射来简化代码。

建议如下重构:

const Demo1 = () => {
+ const items = Array(8).fill({ text: '文字' });
  return (
    <Grid>
-     <Grid.Item text="文字">
-       <Image />
-     </Grid.Item>
-     <Grid.Item text="文字">
-       <Image />
-     </Grid.Item>
-     // ... 重复的结构
+     {items.map((item, index) => (
+       <Grid.Item key={index} text={item.text}>
+         <Image />
+       </Grid.Item>
+     ))}
    </Grid>
  )
}
src/packages/grid/demos/taro/demo8.tsx (1)

Based on the search results, I can now generate the final response since I have enough information about the Image component usage across all demo files.

建议统一 Image 组件的使用方式

在不同的 demo 文件中,Image 组件的使用方式存在不一致:

  • demo8.tsx 中使用了 sizecolor 等属性
  • demo9.tsx 中使用了 srcstyle 属性
  • 其他 demo 文件(demo1-7, demo10)中使用的是无属性的 <Image />

建议:

  • 统一基础 demo 中 Image 组件的展示风格
  • 如果是为了展示不同的使用场景,建议添加相应的注释说明
🔗 Analysis chain

Line range hint 1-29: 验证组件样式一致性

由于这是演示文件,建议确认所有 demo 文件中的图标样式是否保持一致。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查其他 demo 文件中的 Image 组件配置是否一致

# 搜索所有 demo 文件中的 Image 组件配置
rg -A 1 '<Image' 'src/packages/grid/demos/taro/'

Length of output: 6130

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 16b173e and 9199a29.

📒 Files selected for processing (9)
  • src/packages/grid/demos/taro/demo1.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo10.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo2.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo3.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo4.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo5.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo6.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo7.tsx (1 hunks)
  • src/packages/grid/demos/taro/demo8.tsx (1 hunks)
🔇 Additional comments (14)
src/packages/grid/demos/taro/demo3.tsx (1)

3-3: 导入更改看起来不错!

@nutui/icons-react-taro 导入 Image 组件的修改符合统一使用图标组件的目标。

src/packages/grid/demos/taro/demo6.tsx (2)

3-3: 导入语句更改正确!

@nutui/icons-react-taro 导入 Image 组件的修改符合统一使用官方图标组件的要求。


Line range hint 1-22: 验证其他演示文件的一致性

需要确保其他演示文件也进行了相同的更改,保持代码库的一致性。

✅ Verification successful

Let me verify if all demo files are using the Image component consistently.


Let me check the actual usage of the Image component in these files to ensure complete consistency.


Let me try a different approach to check the Image component usage.


代码库中 Image 组件的导入和使用已保持一致性

根据验证结果,所有 Grid 演示文件都已正确从 '@nutui/icons-react-taro' 导入 Image 组件,并在 Grid.Item 中以一致的方式使用。具体表现为:

  • 所有演示文件都使用了正确的导入语句 import { Image } from '@nutui/icons-react-taro'
  • Image 组件在各个演示文件中都作为 Grid.Item 的子组件使用
  • 基本用法保持一致,仅在 demo8 和 demo9 中因特定演示需求添加了额外的属性
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查其他演示文件是否也更新了 Image 组件的导入
rg -l "import.*Image.*from '@nutui/icons-react-taro'" src/packages/grid/demos/taro/

Length of output: 443


Script:

#!/bin/bash
# Check the Image component usage pattern in all demo files
rg "import.*Image.*from '@nutui/icons-react-taro'" src/packages/grid/demos/taro/ -A 1

Length of output: 1339


Script:

#!/bin/bash
# Check how Image component is used in the Grid.Item components
ast-grep --pattern $'<Grid.Item$$$>
  <Image $$$/>
</Grid.Item>'

Length of output: 65


Script:

#!/bin/bash
# Check Image component usage in all demo files
rg "<Image" src/packages/grid/demos/taro/ -B 1 -A 1

Length of output: 9339

src/packages/grid/demos/taro/demo7.tsx (1)

3-3: 导入语句的修改符合预期!

@nutui/icons-react-taro 包导入 Image 组件是正确的做法,这样可以保持与其他 Taro 示例的一致性。

src/packages/grid/demos/taro/demo5.tsx (2)

3-3: 导入更改符合最佳实践!

使用 @nutui/icons-react-taro 包中的 Image 组件替换本地实现是一个很好的改进,这样可以:

  • 确保图标实现的一致性
  • 减少代码重复
  • 便于维护和更新

Line range hint 10-21: 请确认文字内容是否需要区分

注意到所有 Grid.Item 都使用相同的文字"文字",请确认:

  1. 这是否是预期的设计
  2. 是否需要为每个项目设置不同的文字内容
src/packages/grid/demos/taro/demo2.tsx (2)

Line range hint 8-24: 组件使用方式正确

Grid组件的结构保持不变,所有Grid.Item中的Image组件使用方式统一且正确。


3-3: 导入更改看起来不错!

从本地组件切换到 @nutui/icons-react-taro 包中的 Image 组件是一个很好的改进,这样可以保持组件的一致性。

让我们验证其他演示文件是否也进行了类似的更改:

✅ Verification successful

导入更改已在所有演示文件中统一实现!

通过验证结果可以看到,所有的 Grid 演示文件(demo1 到 demo10)都已经统一使用了来自 @nutui/icons-react-taro 的 Image 组件,保持了良好的一致性。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证所有demo文件是否都使用了新的Image导入
# 预期:所有demo文件都应该从 @nutui/icons-react-taro 导入 Image

# 检查所有demo文件中的Image导入
rg "import.*Image.*from.*@nutui/icons-react-taro" src/packages/grid/demos/taro/

Length of output: 865

src/packages/grid/demos/taro/demo10.tsx (2)

3-3: 导入语句更改符合预期

@nutui/icons-react-taro 导入 Image 组件的修改与其他演示文件保持一致,这是一个良好的改进。


Line range hint 11-25: 验证图标展示效果

由于更改了图标组件的来源,建议确认:

  1. 新的 Image 组件在网格中的显示效果
  2. 组件在不同尺寸下的自适应表现

请在实际设备上验证以下场景:

  • 不同屏幕尺寸下的显示效果
  • 暗色模式下的显示效果
  • 图标大小是否合适
src/packages/grid/demos/taro/demo1.tsx (1)

3-3: 从本地实现迁移到官方图标库是个很好的改进!

使用 @nutui/icons-react-taro 的标准图标组件替换本地实现是一个更好的方案,可以提供更好的一致性和可维护性。

验证其他使用此演示组件的地方是否需要更新:

✅ Verification successful

从本地实现迁移到官方图标库的改动已确认安全

该改动仅影响 Grid 组件的演示文件 demo1.tsx,且该演示文件只在 Grid 组件的演示页面中被引用,不会影响其他组件或实际业务代码。这是一个安全的改进。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 搜索可能受影响的导入声明
rg -l "from.*['\"]\.\.\/demos\/taro\/demo1['\"]"

Length of output: 173


Script:

#!/bin/bash
# Search for imports of demo1 using ripgrep with proper escaping
rg -l "from.*['\"].*demo1['\"]"

# Also check if demo1 is used as a component
rg "demo1" -A 2 -B 2

Length of output: 194682


Script:

#!/bin/bash
# Check if demo1.tsx is imported by any other files in the grid component
rg -l "from.*['\"].*grid.*demo1['\"]" src/packages/grid/

# Check if demo1.tsx is used as a component in grid
rg "Demo1" src/packages/grid/

Length of output: 1042

src/packages/grid/demos/taro/demo8.tsx (1)

3-3: 导入语句正确!

@nutui/icons-react-taro 包中导入 Image 组件的方式符合规范。

src/packages/grid/demos/taro/demo4.tsx (2)

Line range hint 5-35: 整体实现结构清晰,代码组织合理!

Grid 布局的使用恰当,Image 组件的布局和文字的搭配也很规范。


3-3: 导入语句的更改看起来没有问题!

从本地组件定义切换到使用 @nutui/icons-react-taro 包中的 Image 组件是一个好的改进,这样可以保持组件的一致性。

让我们验证其他演示文件是否也进行了类似的更改:

✅ Verification successful

导入更改已在所有演示文件中保持一致!

经验证,所有 Grid 组件的 Taro 演示文件(demo1 到 demo10)都已统一使用 @nutui/icons-react-taro 包中的 Image 组件,保持了良好的一致性。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证所有demo文件中的Image组件导入是否一致

# 测试:检查所有demo文件中的Image导入
rg -l "import.*Image.*from.*@nutui/icons-react-taro" "src/packages/grid/demos/taro/"

Length of output: 436

Comment on lines +9 to +24
<Image size={16} />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image color="red" /> */}
<Text style={{ color: 'red' }}>T</Text>
<Image color="red" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={30} color="#478EF2" /> */}
<Text style={{ color: '#478EF2', fontSize: pxTransform(30) }}>T</Text>
<Image size={30} color="#478EF2" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={16} /> */}
<Text style={{ fontSize: pxTransform(16) }}>T</Text>
<Image size={16} />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image color="red" /> */}
<Text style={{ color: 'red' }}>T</Text>
<Image color="red" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={30} color="#478EF2" /> */}
<Text style={{ color: '#478EF2', fontSize: pxTransform(30) }}>T</Text>
<Image size={30} color="#478EF2" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

建议优化 Image 组件的使用方式

目前的实现存在以下问题:

  1. 部分 Image 组件缺少 size 属性
  2. size 值不一致(16 和 30)
  3. 缺少无障碍支持的 alt 属性
  4. 代码结构重复,可以进行优化

建议按照以下方式重构:

import React from 'react'
import { Grid } from '@nutui/nutui-react-taro'
import { Image } from '@nutui/icons-react-taro'

+const GRID_ITEMS = [
+  { size: 16, color: undefined },
+  { color: 'red' },
+  { size: 30, color: '#478EF2' },
+  { size: 16, color: undefined },
+  { color: 'red' },
+  { size: 30, color: '#478EF2' },
+]

const Demo8 = () => {
  return (
    <Grid columns="3">
-      <Grid.Item text="文字">
-        <Image size={16} />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image color="red" />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image size={30} color="#478EF2" />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image size={16} />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image color="red" />
-      </Grid.Item>
-      <Grid.Item text="文字">
-        <Image size={30} color="#478EF2" />
-      </Grid.Item>
+      {GRID_ITEMS.map((item, index) => (
+        <Grid.Item text="文字" key={index}>
+          <Image
+            size={item.size || 20}
+            color={item.color}
+            alt={`图标 ${index + 1}`}
+          />
+        </Grid.Item>
+      ))}
    </Grid>
  )
}

优化说明:

  1. 使用数组配置统一管理图标属性
  2. 为未设置 size 的图标提供默认值 20
  3. 添加 alt 属性支持无障碍访问
  4. 使用 map 减少代码重复
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Image size={16} />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image color="red" /> */}
<Text style={{ color: 'red' }}>T</Text>
<Image color="red" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={30} color="#478EF2" /> */}
<Text style={{ color: '#478EF2', fontSize: pxTransform(30) }}>T</Text>
<Image size={30} color="#478EF2" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={16} /> */}
<Text style={{ fontSize: pxTransform(16) }}>T</Text>
<Image size={16} />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image color="red" /> */}
<Text style={{ color: 'red' }}>T</Text>
<Image color="red" />
</Grid.Item>
<Grid.Item text="文字">
{/* <Image size={30} color="#478EF2" /> */}
<Text style={{ color: '#478EF2', fontSize: pxTransform(30) }}>T</Text>
<Image size={30} color="#478EF2" />
import React from 'react'
import { Grid } from '@nutui/nutui-react-taro'
import { Image } from '@nutui/icons-react-taro'
const GRID_ITEMS = [
{ size: 16, color: undefined },
{ color: 'red' },
{ size: 30, color: '#478EF2' },
{ size: 16, color: undefined },
{ color: 'red' },
{ size: 30, color: '#478EF2' },
]
const Demo8 = () => {
return (
<Grid columns="3">
{GRID_ITEMS.map((item, index) => (
<Grid.Item text="文字" key={index}>
<Image
size={item.size || 20}
color={item.color}
alt={`图标 ${index + 1}`}
/>
</Grid.Item>
))}
</Grid>
)
}

@xiaoyatong xiaoyatong merged commit 60d5c80 into jdf2e:V3.0 Nov 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants