-
-
Notifications
You must be signed in to change notification settings - Fork 168
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: ✨ Swiper 轮播组件增加value-key用于自定义目标字段属性名 #485
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次修改增强了 Changes
Assessment against linked issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying wot-design-uni with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- docs/component/swiper.md (3 hunks)
- src/pages/swiper/Index.vue (3 hunks)
- src/uni_modules/wot-design-uni/components/wd-swiper/types.ts (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-swiper/wd-swiper.vue (2 hunks)
Additional comments not posted (10)
src/uni_modules/wot-design-uni/components/wd-swiper/types.ts (2)
23-23
: 更改SwiperList
接口中的value
属性为可选将
value
属性更改为可选属性提高了接口的灵活性,允许在某些情况下省略该属性。
146-149
: 添加valueKey
属性到swiperProps
新增的
valueKey
属性允许用户指定选项对象中value
对应的键,增强了 Swiper 组件的灵活性。src/uni_modules/wot-design-uni/components/wd-swiper/wd-swiper.vue (2)
20-22
: 调整模板中的图片来源绑定图片来源绑定现在根据
valueKey
从item
对象中获取属性,确保正确的图片来源动态确定,增强了灵活性。
164-167
: 更新handleClick
函数以接受额外的item
参数
handleClick
函数现在接受一个额外的item
参数,使组件在点击 swiper 项时能够发出索引和项内容,提供更多上下文信息。src/pages/swiper/Index.vue (2)
113-115
: 添加新的演示块以展示value-key
属性的使用新增的演示块展示了如何使用
value-key
属性,提供了一个清晰的示例。
145-151
: 添加customSwiperList
和current9
的响应式引用新增的响应式引用
customSwiperList
和current9
用于管理新演示块的状态,确保其正常运行。Also applies to: 161-161
docs/component/swiper.md (4)
189-191
: 文档更新: 指定value-key
属性文档清晰地介绍了如何使用
value-key
属性来指定list
中每个对象图片地址字段,默认为value
。这有助于用户理解和使用该新功能。
194-196
: 示例代码: 使用value-key
属性示例代码展示了如何使用
value-key
属性来指定对象中的图片URL字段。代码清晰易懂,能够帮助用户快速上手新功能。
198-205
: 示例代码: 自定义swiperList
示例代码展示了如何定义一个包含对象的
swiperList
,并使用value-key
属性来指定图片URL字段。代码清晰且符合实际使用场景。
289-289
: 事件更新:click
事件参数文档更新了
click
事件的参数,现在不仅返回点击项的索引,还返回相关项的内容。这一改进为事件处理提供了更多上下文信息,增强了事件的实用性。
✅ Closes: #410
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
提供
value-key
属性用于自定义选项值字段☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
wd-swiper
组件中添加了value-key
属性,允许用户自定义图像 URL 的键。click
事件的参数,提供了更详尽的事件信息,包括点击项的内容。Index.vue
中引入新的演示块,支持动态显示自定义图像列表。文档
wd-swiper
文档,增加了使用value-key
属性及更新后的click
事件签名示例。