Skip to content

Commit e50cccc

Browse files
fix: 🐛 修复ActionSheet丢失props默认值的问题
1 parent 443fd8a commit e50cccc

File tree

1 file changed

+31
-22
lines changed
  • src/uni_modules/wot-design-uni/components/wd-action-sheet

1 file changed

+31
-22
lines changed

src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
* @Author: weisheng
33
* @Date: 2024-03-18 11:22:03
4-
* @LastEditTime: 2024-03-18 13:17:22
4+
* @LastEditTime: 2024-04-04 22:35:25
55
* @LastEditors: weisheng
66
* @Description:
7-
* @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-action-sheet\types.ts
7+
* @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts
88
* 记得注释
99
*/
1010
import type { ExtractPropTypes } from 'vue'
11-
import { baseProps, makeArrayProp, makeBooleanProp, makeRequiredProp, makeStringProp } from '../common/props'
11+
import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, makeRequiredProp, makeStringProp } from '../common/props'
1212

1313
export type Action = {
1414
/**
@@ -48,65 +48,74 @@ export const actionSheetProps = {
4848
...baseProps,
4949
/**
5050
* header 头部样式
51+
* @default ''
52+
* @type {string}
5153
*/
5254
customHeaderClass: makeStringProp(''),
5355
/**
5456
* 设置菜单显示隐藏
57+
* @default false
58+
* @type {boolean}
5559
*/
5660
modelValue: { ...makeBooleanProp(false), ...makeRequiredProp(Boolean) },
5761
/**
5862
* 菜单选项
63+
* @default []
64+
* @type {Action[]}
5965
*/
6066
actions: makeArrayProp<Action>(),
6167
/**
6268
* 自定义面板项,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多行展示
69+
* @default []
70+
* @type {Array<Panel | Panel[]>}
6371
*/
6472
panels: makeArrayProp<Panel | Panel[]>(),
6573
/**
6674
* 标题
75+
* @type {string}
6776
*/
6877
title: String,
6978
/**
7079
* 取消按钮文案
80+
* @type {string}
7181
*/
7282
cancelText: String,
7383
/**
7484
* 点击选项后是否关闭菜单
85+
* @default true
86+
* @type {boolean}
7587
*/
76-
closeOnClickAction: Boolean,
88+
closeOnClickAction: makeBooleanProp(true),
7789
/**
7890
* 点击遮罩是否关闭
91+
* @default true
92+
* @type {boolean}
7993
*/
80-
closeOnClickModal: Boolean,
94+
closeOnClickModal: makeBooleanProp(true),
8195
/**
8296
* 弹框动画持续时间
97+
* @default 200
98+
* @type {number}
8399
*/
84-
duration: Number,
100+
duration: makeNumberProp(200),
85101
/**
86102
* 菜单层级
103+
* @default 10
104+
* @type {number}
87105
*/
88-
zIndex: Number,
106+
zIndex: makeNumberProp(10),
89107
/**
90108
* 弹层内容懒渲染,触发展示时才渲染内容
109+
* @default true
110+
* @type {boolean}
91111
*/
92-
lazyRender: Boolean,
112+
lazyRender: makeBooleanProp(true),
93113
/**
94114
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
115+
* @default true
116+
* @type {boolean}
95117
*/
96-
safeAreaInsetBottom: Boolean
118+
safeAreaInsetBottom: makeBooleanProp(true)
97119
}
98120

99121
export type ActionSheetProps = ExtractPropTypes<typeof actionSheetProps>
100-
101-
// export type SelectPanelOption = {
102-
// item: Panel | Action
103-
// index?: number
104-
// rowIndex?: number
105-
// colIndex?: number
106-
// }
107-
108-
// export const actionSheetEmits = {
109-
// [UPDATE_MODEL_EVENT]: (newValue: boolean) => isBoolean(newValue),
110-
// select: (option: SelectPanelOption) => option !== undefined
111-
// }
112-
// export type ActionSheetEmits = typeof actionSheetEmits

0 commit comments

Comments
 (0)