Skip to content

wd-select-picker 组件添加附加数据功能,关联 issue #1401#1446

Open
dahaha-365 wants to merge 1 commit into
Moonofweisheng:masterfrom
dahaha-365:master
Open

wd-select-picker 组件添加附加数据功能,关联 issue #1401#1446
dahaha-365 wants to merge 1 commit into
Moonofweisheng:masterfrom
dahaha-365:master

Conversation

@dahaha-365

@dahaha-365 dahaha-365 commented Jan 18, 2026

Copy link
Copy Markdown

🤔 这个 PR 的性质是?(至少选择一个)

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

🔗 相关 Issue

[新功能需求] wd-select-picker新增一个插槽,可以自定义列表样式

💡 需求背景和解决方案

使用wd-select-picker进行人员选择时,除了显示label以外,还需要显示人员的部门、手机号等信息,通过插槽自定义可以做出自己想要的效果。

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

发布说明

  • 新功能

    • Select-picker 组件新增 addition 插槽功能,支持为选项渲染额外信息。用户现在可以通过该插槽在每个选项中显示自定义附加数据。
  • 文档

    • 新增文档说明 select-picker 组件的附加数据使用方法,包含完整的代码示例。

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify

netlify Bot commented Jan 18, 2026

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 709ca9a
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/696c593195b970000838f2f5
😎 Deploy Preview https://deploy-preview-1446--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jan 18, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jan 18, 2026

Copy link
Copy Markdown

Walkthrough

向select-picker组件增加"附加数据"功能,包括国际化文本、组件模板插槽、样式和文档示例。允许在选择器中为每个选项显示额外的自定义内容。

Changes

cohort / 文件 变更摘要
国际化配置
src/locale/zh-CN.json, src/locale/en-US.json
分别添加"fu-jia-shu-ju"本地化键值,对应中文"附加数据"和英文"Additional data"
组件核心实现
src/uni_modules/wot-design-uni/components/wd-select-picker/wd-select-picker.vue, src/uni_modules/wot-design-uni/components/wd-select-picker/index.scss
在checkbox和radio项的渲染路径中添加命名插槽"addition"和对应的flex容器样式;允许自定义每项的额外内容展示
示例和文档
src/subPages/selectPicker/Index.vue, docs/component/select-picker.md
新增columns3数据集(包含additional对象)、演示使用addition插槽渲染额外字段的完整示例;文档中补充"附加数据"功能说明和用法演示

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • Moonofweisheng

Poem

🐰 ✨
选择框中加数据,
插槽展示更详情,
每项多了小故事,
标签和位置齐亮相,
补充完美的信息!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title clearly describes the main change: adding additional data functionality to wd-select-picker component and references issue #1401. The title accurately reflects the feature addition shown in the changesets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.md

markdownlint-cli2 v0.18.1 (markdownlint v0.38.0)
Finding: docs/component/select-picker.md
Linting: 1 file(s)
Summary: 0 error(s)
Error: EACCES: permission denied, open '/markdownlint-cli2-results.json'
at async open (node:internal/fs/promises:640:25)
at async Object.writeFile (node:internal/fs/promises:1214:14)
at async Promise.all (index 0)
at async outputSummary (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:877:5)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:1053:25)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:12:22 {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/markdownlint-cli2-results.json'
}


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 行的选择器共用同一个变量,但它们使用不同的数据源(columns1 vs columns3)。当用户在一个选择器中选择的值在另一个选择器的数据源中不存在时,可能会导致显示异常。

建议为附加数据示例创建独立的绑定变量:

♻️ 建议修改
+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-commenter

codecov-commenter commented Jun 19, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (3b6833c) to head (709ca9a).
⚠️ Report is 9 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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     
Flag Coverage Δ
h5 88.14% <100.00%> (-1.76%) ⬇️
wd-action-sheet ?
wd-avatar ?
wd-avatar-group ?
wd-backtop ?
wd-badge ?
wd-button ?
wd-calendar ?
wd-calendar-view ?
wd-card ?
wd-cell ?
wd-cell-group ?
wd-checkbox ?
wd-checkbox-group ?
wd-circle ?
wd-col-picker ?
wd-collapse ?
wd-config-provider ?
wd-count-down ?
wd-count-to ?
wd-curtain ?
wd-datetime-picker ?
wd-datetime-picker-view ?
wd-divider ?
wd-drop-menu ?
wd-fab ?
wd-floating-panel ?
wd-form ?
wd-gap ?
wd-grid ?
wd-grid-item ?
wd-icon ?
wd-img ?
wd-img-cropper ?
wd-index-anchor ?
wd-index-bar ?
wd-input ?
wd-input-number ?
wd-keyboard ?
wd-layout ?
wd-loading ?
wd-loadmore ?
wd-message-box ?
wd-navbar ?
wd-navbar-capsule ?
wd-notice-bar ?
wd-notify ?
wd-number-keyboard ?
wd-overlay ?
wd-pagination ?
wd-password-input ?
wd-picker ?
wd-picker-view ?
wd-popover ?
wd-popup ?
wd-progress ?
wd-radio ?
wd-radio-group ?
wd-rate ?
wd-resize ?
wd-root-portal ?
wd-search ?
wd-segmented ?
wd-select-picker 88.14% <100.00%> (+0.01%) ⬆️
wd-sidebar ?
wd-signature ?
wd-skeleton ?
wd-slide-verify ?
wd-slider ?
wd-sort-button ?
wd-status-tip ?
wd-step ?
wd-steps ?
wd-sticky ?
wd-sticky-box ?
wd-swipe-action ?
wd-swiper ?
wd-swiper-nav ?
wd-switch ?
wd-tabbar ?
wd-table ?
wd-tag ?
wd-text ?
wd-textarea ?
wd-toast ?
wd-tooltip ?
wd-tour ?
wd-transition ?
wd-upload ?
wd-video-preview ?
wd-watermark ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants