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(wd-datetime-picker): datetime-picker 增加自定义 Cell 样式属性 #491

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/component/datetime-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,6 @@ const displayFormatTabLabel = (items) => {
| 类名 | 说明 | 最低版本 |
|-----|------|--------|
| custom-view-class | pickerView 外部自定义样式 | - |
| custom-cell-class | pickerView cell 外部自定义样式 | - |
| custom-label-class | label 外部自定义样式 | - |
| custom-value-class | value 外部自定义样式 | - |
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ export const datetimePickerProps = {
* 表单验证规则,结合wd-form组件使用
*/
rules: makeArrayProp<FormItemRule>(),
/**
* picker cell 外部自定义样式
*/
customCellClass: makeStringProp(''),
/**
* pickerView 外部自定义样式
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!--文案-->
<view class="wd-picker__field" @click="showPopup">
<slot v-if="useDefaultSlot"></slot>
<view v-else class="wd-picker__cell">
<view v-else :class="['wd-picker__cell', customCellClass]">
<view
v-if="label || useLabelSlot"
:class="`wd-picker__label ${customLabelClass} ${isRequired ? 'is-required' : ''}`"
Expand Down