wd-select-picker 组件添加附加数据功能,关联 issue #1401#1446
Conversation
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@dahaha-365 is attempting to deploy a commit to the weisheng's projects Team on Vercel. A member of the Team first needs to authorize it. |
Walkthrough向select-picker组件增加"附加数据"功能,包括国际化文本、组件模板插槽、样式和文档示例。允许在选择器中为每个选项显示额外的自定义内容。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 markdownlint-cli2 (0.18.1)docs/component/select-picker.mdmarkdownlint-cli2 v0.18.1 (markdownlint v0.38.0) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/component/select-picker.md (1)
437-442: Slots 表格缺少新增的addition插槽文档。文档中新增了"附加数据"章节说明
addition插槽的用法,但 Slots 表格中没有相应的条目,这会导致 API 参考不完整。📝 建议补充
## Slots | 插槽名称 | 说明 | 最低版本 | | -------- | ---------- | -------- | | default | 自定义展示 | - | | label | 左侧插槽 | - | +| addition | 选项附加数据插槽,参数:`{ item }` | - |
🧹 Nitpick comments (1)
src/subPages/selectPicker/Index.vue (1)
57-69: 新的附加数据选择器与"可清空"选择器共享value20,可能导致数据不一致。第 61 行的
v-model="value20"与第 53 行的选择器共用同一个变量,但它们使用不同的数据源(columns1vscolumns3)。当用户在一个选择器中选择的值在另一个选择器的数据源中不存在时,可能会导致显示异常。建议为附加数据示例创建独立的绑定变量:
♻️ 建议修改
+const value22 = ref<string>('101')然后更新模板:
<wd-select-picker :label="$t('fu-jia-shu-ju')" type="radio" :show-confirm="false" - v-model="value20" + v-model="value22" :columns="columns3" `@confirm`="handleConfirm2" >
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1446 +/- ##
==========================================
- Coverage 89.90% 88.14% -1.76%
==========================================
Files 226 38 -188
Lines 31308 4810 -26498
Branches 2900 104 -2796
==========================================
- Hits 28148 4240 -23908
+ Misses 3160 570 -2590 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
[新功能需求] wd-select-picker新增一个插槽,可以自定义列表样式
💡 需求背景和解决方案
使用wd-select-picker进行人员选择时,除了显示label以外,还需要显示人员的部门、手机号等信息,通过插槽自定义可以做出自己想要的效果。
☑️ 请求合并前的自查清单
Summary by CodeRabbit
发布说明
新功能
addition插槽功能,支持为选项渲染额外信息。用户现在可以通过该插槽在每个选项中显示自定义附加数据。文档
✏️ Tip: You can customize this high-level summary in your review settings.