-
-
Notifications
You must be signed in to change notification settings - Fork 190
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: ✨ MessageBox 增加 showConfirmButton 配置 #837
base: master
Are you sure you want to change the base?
feat: ✨ MessageBox 增加 showConfirmButton 配置 #837
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
概述遍历此拉取请求为 变更
可能相关的 PRs
建议的审阅者
诗歌
Finishing Touches
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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: 1
🧹 Nitpick comments (1)
src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue (1)
38-40
: 建议优化模板可读性当前的 v-if 条件直接嵌入在模板中,建议将复杂的条件判断抽取为计算属性以提高可读性。
- <wd-button v-bind="customConfirmProps" v-if="messageState.showConfirmButton" @click="toggleModal('confirm')"> + <wd-button v-bind="customConfirmProps" v-if="showConfirmButtonVisible" @click="toggleModal('confirm')"> {{ messageState.confirmButtonText || translate('confirm') }} </wd-button>添加计算属性:
const showConfirmButtonVisible = computed(() => messageState.showConfirmButton)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/component/message-box.md
(1 hunks)src/uni_modules/wot-design-uni/components/wd-message-box/types.ts
(1 hunks)src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue
(3 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
docs/component/message-box.md
265-265: Expected: 6; Actual: 5; Too few cells, row will be missing data
Table column count
(MD056, table-column-count)
266-266: Expected: 6; Actual: 5; Too few cells, row will be missing data
Table column count
(MD056, table-column-count)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - wot-design-uni
- GitHub Check: Header rules - wot-design-uni
- GitHub Check: Pages changed - wot-design-uni
🔇 Additional comments (2)
src/uni_modules/wot-design-uni/components/wd-message-box/types.ts (1)
25-28
: 类型定义清晰且文档完整!类型定义添加合理,并且包含了清晰的注释说明。
src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue (1)
87-87
: 状态管理实现完整且合理!
- 正确初始化了
showConfirmButton
的默认值- 在 reset 函数中正确处理了选项值的更新
Also applies to: 263-263
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
参考其它UI库,应允许不展示确定按钮,同时完善了showConfirmButton和showCancelButton两个配置项的文档说明。
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
showConfirmButton
和showCancelButton
配置属性,默认为true