Skip to content

Commit 2cc7d7f

Browse files
authored
feat: ✨ datetime-picker 增加自定义 Cell 样式属性 (#491)
1 parent 35507a1 commit 2cc7d7f

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

docs/component/datetime-picker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,5 +334,6 @@ const displayFormatTabLabel = (items) => {
334334
| 类名 | 说明 | 最低版本 |
335335
|-----|------|--------|
336336
| custom-view-class | pickerView 外部自定义样式 | - |
337+
| custom-cell-class | pickerView cell 外部自定义样式 | $LOWEST_VERSION$ |
337338
| custom-label-class | label 外部自定义样式 | - |
338339
| custom-value-class | value 外部自定义样式 | - |

src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ export const datetimePickerProps = {
155155
* 表单验证规则,结合wd-form组件使用
156156
*/
157157
rules: makeArrayProp<FormItemRule>(),
158+
/**
159+
* picker cell 外部自定义样式
160+
*/
161+
customCellClass: makeStringProp(''),
158162
/**
159163
* pickerView 外部自定义样式
160164
*/

src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!--文案-->
99
<view class="wd-picker__field" @click="showPopup">
1010
<slot v-if="useDefaultSlot"></slot>
11-
<view v-else class="wd-picker__cell">
11+
<view v-else :class="['wd-picker__cell', customCellClass]">
1212
<view
1313
v-if="label || useLabelSlot"
1414
:class="`wd-picker__label ${customLabelClass} ${isRequired ? 'is-required' : ''}`"

0 commit comments

Comments
 (0)