@wyfex/ivue 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ /**
2
+ * 组件props
3
+ */
4
+ export default {
5
+ /**
6
+ * el-drawer的标题
7
+ */
8
+ title: {
9
+ type: String,
10
+ default: '欢迎使用wyfex-ivue抽屉组件'
11
+ },
12
+ /**
13
+ * el-drawer的窗体的大小, 当使用number类型时, 以像素为单位, 当使用string类型时, 请传入'xx%'、'xxxpx'等,否则便会以number类型解释 默认1100px
14
+ */
15
+ size: {
16
+ type: [Number, String],
17
+ default: 1100
18
+ },
19
+ /**
20
+ * el-drawer自身是否插入至body元素上。嵌套的el-drawer必须指定该属性并赋值为 true 默认是
21
+ */
22
+ appendToBody: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ /**
27
+ * 控制是否在关闭el-drawer后将子元素全部销毁 默认是
28
+ */
29
+ destroyOnClose: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ /**
34
+ * 是否可以通过点击modal关闭el-drawer 默认否
35
+ */
36
+ closeOnClickModal: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ /**
41
+ * 是否显示全屏图标 默认是
42
+ */
43
+ showFullScreenIcon: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ /**
48
+ * 是否显示footer 默认显示,可通过<template #footer></template>插槽自定义footer内容
49
+ */
50
+ showFooter: {
51
+ type: Boolean,
52
+ default: true
53
+ },
54
+ /**
55
+ * 底部定位 默认left
56
+ */
57
+ footerPosition: {
58
+ type: String,
59
+ default: 'left',
60
+ validator: (val: string) => ['left', 'center', 'right'].includes(val)
61
+ },
62
+ /**
63
+ * 是否严格区分close事件 默认否 和onClose事件二选一设置一个即可
64
+ */
65
+ strictCloseEvent: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ /**
70
+ * 抽屉关闭图标事件 若未设置且未开启strictCloseEvent则默认执行onCancel事件
71
+ */
72
+ onClose: {
73
+ type: Function,
74
+ default: () => {}
75
+ },
76
+ /**
77
+ * 确定按钮文本
78
+ */
79
+ confirmBtnText: {
80
+ type: String,
81
+ default: '保存'
82
+ },
83
+ /**
84
+ * 取消按钮文本
85
+ */
86
+ cancelBtnText: {
87
+ type: String,
88
+ default: '取消'
89
+ },
90
+ /**
91
+ * 取消按钮类型 同ElButton类型
92
+ */
93
+ cancelBtnType: {
94
+ type: String,
95
+ default: '',
96
+ validator: (val: string) =>
97
+ [
98
+ '',
99
+ 'default',
100
+ 'primary',
101
+ 'success',
102
+ 'warning',
103
+ 'danger',
104
+ 'info'
105
+ ].includes(val)
106
+ },
107
+ /**
108
+ * 确定按钮事件
109
+ */
110
+ onConfirm: {
111
+ type: Function,
112
+ default: () => {}
113
+ },
114
+ /**
115
+ * 取消按钮事件
116
+ */
117
+ onCancel: {
118
+ type: Function,
119
+ default: () => {}
120
+ }
121
+ }
@@ -0,0 +1,7 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+
4
+ /**
5
+ * props类型
6
+ */
7
+ export type Props = ExtractPropTypes<typeof componentProps>
@@ -20,9 +20,9 @@ export default {
20
20
  default: '、'
21
21
  },
22
22
  /**
23
- * content为对象数组时需要转为字符串的key 默认label
23
+ * content为对象数组或对象时需要转为字符串的key 默认label
24
24
  */
25
- convertKey: {
25
+ parseKey: {
26
26
  type: String,
27
27
  default: 'label'
28
28
  },
@@ -9,6 +9,7 @@ export type RenderContent =
9
9
  | number
10
10
  | boolean
11
11
  | unknown[]
12
+ | Record<string, any>
12
13
  | VNode
13
14
  | Component
14
15