feat: wd-picker-view 添加 item-height 属性

Co-authored-by: zhujihui <zhujihui@primecare.group>
This commit is contained in:
zjh 2025-09-27 17:01:52 +08:00 committed by GitHub
parent 8efad6d340
commit 8d84508165
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 11 additions and 1 deletions

View File

@ -144,6 +144,7 @@ const filter = (type, values) => {
| loading | 加载中 | boolean | - | false | - |
| loading-color | 加载的颜色,只能使用十六进制的色值写法,且不能使用缩写 | string | - | #4D80F0 | - |
| columns-height | picker内部滚筒高 | number | - | 231 | - |
| item-height | picker item的高度 | number | - | 35 | - |
| formatter | 自定义弹出层选项文案的格式化函数,返回一个字符串 | function | - | - | - |
| filter | 自定义过滤选项的函数,返回列的选项数组 | function | - | - | - |
| minDate | 最小日期13 位的时间戳 | `timestamp` | - | 当前日期 - 10年 | - |

View File

@ -289,6 +289,7 @@ const displayFormatTabLabel = (items) => {
| loading | 加载中 | boolean | - | false | - |
| loading-color | 加载的颜色,只能使用十六进制的色值写法,且不能使用缩写 | string | - | #4D80F0 | - |
| columns-height | picker内部滚筒高 | number | - | 231 | - |
| item-height | picker item的高度 | number | - | 35 | - |
| title | 弹出层标题 | string | - | - | - |
| cancel-button-text | 取消按钮文案 | string | - | 取消 | - |
| confirm-button-text | 确认按钮文案 | string | - | 完成 | - |

View File

@ -21,6 +21,10 @@ export const datetimePickerViewProps = {
* picker内部滚筒高
*/
columnsHeight: makeNumberProp(217),
/**
* picker item的高度
*/
itemHeight: makeNumberProp(35),
/**
* key
*/

View File

@ -7,6 +7,7 @@
v-model="pickerValue"
:columns="columns"
:columns-height="columnsHeight"
:item-height="itemHeight"
:columnChange="columnChange"
:loading="loading"
:loading-color="loadingColor"

View File

@ -30,6 +30,10 @@ export const pickerViewProps = {
* picker内部滚筒高
*/
columnsHeight: makeNumberProp(217),
/**
* picker item的高度
*/
itemHeight: makeNumberProp(35),
/**
* value对应的 key
*/

View File

@ -52,7 +52,6 @@ const props = defineProps(pickerViewProps)
const emit = defineEmits(['change', 'pickstart', 'pickend', 'update:modelValue'])
const formatColumns = ref<ColumnItem[][]>([]) //
const itemHeight = ref<number>(35)
const selectedIndex = ref<Array<number>>([]) //
watch(