uview-pro 0.0.7 → 0.0.8
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.
- package/changelog.md +5 -0
- package/components/u-action-sheet/types.ts +35 -0
- package/components/u-action-sheet/u-action-sheet.vue +2 -47
- package/components/u-alert-tips/types.ts +39 -0
- package/components/u-alert-tips/u-alert-tips.vue +3 -32
- package/components/u-avatar/types.ts +34 -0
- package/components/u-avatar/u-avatar.vue +3 -30
- package/components/u-avatar-cropper/types.ts +23 -0
- package/components/u-avatar-cropper/u-avatar-cropper.vue +2 -45
- package/components/u-back-top/types.ts +39 -0
- package/components/u-back-top/u-back-top.vue +2 -33
- package/components/u-badge/types.ts +36 -0
- package/components/u-badge/u-badge.vue +2 -26
- package/components/u-button/types.ts +66 -0
- package/components/u-button/u-button.vue +3 -88
- package/components/u-calendar/types.ts +63 -0
- package/components/u-calendar/u-calendar.vue +2 -135
- package/components/u-car-keyboard/types.ts +12 -0
- package/components/u-car-keyboard/u-car-keyboard.vue +2 -4
- package/components/u-card/types.ts +59 -0
- package/components/u-card/u-card.vue +2 -48
- package/components/u-cell-group/types.ts +17 -0
- package/components/u-cell-group/u-cell-group.vue +3 -9
- package/components/u-cell-item/types.ts +54 -0
- package/components/u-cell-item/u-cell-item.vue +2 -45
- package/components/u-checkbox/types.ts +31 -0
- package/components/u-checkbox/u-checkbox.vue +2 -47
- package/components/u-checkbox-group/types.ts +32 -0
- package/components/u-checkbox-group/u-checkbox-group.vue +2 -57
- package/components/u-circle-progress/types.ts +52 -0
- package/components/u-circle-progress/u-circle-progress.vue +2 -23
- package/components/u-city-select/types.ts +20 -0
- package/components/u-city-select/u-city-select.vue +2 -10
- package/components/u-col/types.ts +30 -0
- package/components/u-col/u-col.vue +2 -14
- package/components/u-collapse/types.ts +31 -0
- package/components/u-collapse/u-collapse.vue +2 -16
- package/components/u-collapse-item/types.ts +25 -0
- package/components/u-collapse-item/u-collapse-item.vue +2 -16
- package/components/u-column-notice/types.ts +48 -0
- package/components/u-column-notice/u-column-notice.vue +2 -97
- package/components/u-count-down/types.ts +42 -0
- package/components/u-count-down/u-count-down.vue +2 -82
- package/components/u-count-to/types.ts +32 -0
- package/components/u-count-to/u-count-to.vue +2 -58
- package/components/u-divider/types.ts +31 -0
- package/components/u-divider/u-divider.vue +2 -22
- package/components/u-dropdown/types.ts +32 -0
- package/components/u-dropdown/u-dropdown.vue +2 -24
- package/components/u-dropdown-item/types.ts +27 -0
- package/components/u-dropdown-item/u-dropdown-item.vue +4 -16
- package/components/u-empty/types.ts +36 -0
- package/components/u-empty/u-empty.vue +3 -26
- package/components/u-field/types.ts +69 -0
- package/components/u-field/u-field.vue +2 -117
- package/components/u-form/types.ts +25 -0
- package/components/u-form/u-form.vue +2 -46
- package/components/u-form-item/types.ts +70 -0
- package/components/u-form-item/u-form-item.vue +2 -62
- package/components/u-full-screen/types.ts +14 -0
- package/components/u-full-screen/u-full-screen.vue +2 -0
- package/components/u-gap/types.ts +18 -0
- package/components/u-gap/u-gap.vue +2 -10
- package/components/u-grid/types.ts +19 -0
- package/components/u-grid/u-grid.vue +3 -11
- package/components/u-grid-item/types.ts +16 -0
- package/components/u-grid-item/u-grid-item.vue +2 -8
- package/components/u-icon/types.ts +62 -0
- package/components/u-icon/u-icon.vue +2 -123
- package/components/u-image/types.ts +39 -38
- package/components/u-index-anchor/types.ts +16 -0
- package/components/u-index-anchor/u-index-anchor.vue +2 -17
- package/components/u-index-list/types.ts +43 -0
- package/components/u-index-list/u-index-list.vue +13 -34
- package/components/u-input/types.ts +140 -0
- package/components/u-input/u-input.vue +2 -209
- package/components/u-keyboard/types.ts +40 -0
- package/components/u-keyboard/u-keyboard.vue +2 -32
- package/components/u-lazy-load/types.ts +37 -0
- package/components/u-lazy-load/u-lazy-load.vue +3 -58
- package/components/u-line/types.ts +44 -0
- package/components/u-line/u-line.vue +2 -14
- package/components/u-line-progress/types.ts +58 -0
- package/components/u-line-progress/u-line-progress.vue +2 -21
- package/components/u-link/types.ts +43 -0
- package/components/u-link/u-link.vue +2 -14
- package/components/u-loading/types.ts +35 -0
- package/components/u-loading/u-loading.vue +2 -23
- package/components/u-loadmore/types.ts +79 -0
- package/components/u-loadmore/u-loadmore.vue +2 -67
- package/components/u-mask/types.ts +43 -0
- package/components/u-mask/u-mask.vue +2 -33
- package/components/u-message-input/types.ts +74 -0
- package/components/u-message-input/u-message-input.vue +2 -62
- package/components/u-modal/types.ts +118 -0
- package/components/u-modal/u-modal.vue +2 -86
- package/components/u-navbar/types.ts +103 -0
- package/components/u-navbar/u-navbar.vue +2 -90
- package/components/u-no-network/types.ts +28 -0
- package/components/u-no-network/u-no-network.vue +2 -23
- package/components/u-notice-bar/types.ts +111 -0
- package/components/u-notice-bar/u-notice-bar.vue +2 -102
- package/components/u-number-box/types.ts +42 -0
- package/components/u-number-box/u-number-box.vue +2 -34
- package/components/u-number-keyboard/types.ts +26 -0
- package/components/u-number-keyboard/u-number-keyboard.vue +2 -8
- package/components/u-picker/types.ts +111 -0
- package/components/u-picker/u-picker.vue +3 -174
- package/components/u-popup/types.ts +59 -0
- package/components/u-popup/u-popup.vue +2 -47
- package/components/u-radio/types.ts +25 -0
- package/components/u-radio/u-radio.vue +2 -16
- package/components/u-radio-group/types.ts +29 -0
- package/components/u-radio-group/u-radio-group.vue +2 -20
- package/components/u-rate/types.ts +40 -0
- package/components/u-rate/u-rate.vue +2 -124
- package/components/u-read-more/types.ts +35 -0
- package/components/u-read-more/u-read-more.vue +2 -51
- package/components/u-row/types.ts +20 -0
- package/components/u-row/u-row.vue +2 -10
- package/components/u-row-notice/types.ts +39 -0
- package/components/u-row-notice/u-row-notice.vue +2 -72
- package/components/u-search/types.ts +53 -0
- package/components/u-search/u-search.vue +2 -44
- package/components/u-section/types.ts +32 -0
- package/components/u-section/u-section.vue +2 -52
- package/components/u-select/types.ts +43 -0
- package/components/u-select/u-select.vue +2 -34
- package/components/u-skeleton/types.ts +20 -0
- package/components/u-skeleton/u-skeleton.vue +2 -27
- package/components/u-slider/types.ts +32 -0
- package/components/u-slider/u-slider.vue +2 -57
- package/components/u-steps/types.ts +28 -0
- package/components/u-steps/u-steps.vue +2 -42
- package/components/u-sticky/types.ts +22 -0
- package/components/u-sticky/u-sticky.vue +2 -32
- package/components/u-subsection/types.ts +36 -0
- package/components/u-subsection/u-subsection.vue +2 -62
- package/components/u-swipe-action/types.ts +50 -0
- package/components/u-swipe-action/u-swipe-action.vue +2 -39
- package/components/u-swiper/types.ts +47 -0
- package/components/u-swiper/u-swiper.vue +2 -41
- package/components/u-switch/types.ts +28 -0
- package/components/u-switch/u-switch.vue +2 -20
- package/components/u-tabbar/types.ts +36 -0
- package/components/u-tabbar/u-tabbar.vue +6 -75
- package/components/u-table/types.ts +25 -0
- package/components/u-table/u-table.vue +2 -51
- package/components/u-tabs/types.ts +51 -0
- package/components/u-tabs/u-tabs.vue +6 -44
- package/components/u-tabs-swiper/types.ts +53 -0
- package/components/u-tabs-swiper/u-tabs-swiper.vue +3 -50
- package/components/u-tag/types.ts +37 -0
- package/components/u-tag/u-tag.vue +2 -28
- package/components/u-td/types.ts +12 -0
- package/components/u-td/u-td.vue +2 -9
- package/components/u-th/types.ts +12 -0
- package/components/u-th/u-th.vue +2 -9
- package/components/u-time-line-item/types.ts +14 -0
- package/components/u-time-line-item/u-time-line-item.vue +2 -12
- package/components/u-toast/types.ts +35 -3
- package/components/u-toast/u-toast.vue +2 -7
- package/components/u-top-tips/types.ts +14 -0
- package/components/u-top-tips/u-top-tips.vue +17 -22
- package/components/u-tr/types.ts +8 -0
- package/components/u-tr/u-tr.vue +3 -0
- package/components/u-upload/types.ts +71 -0
- package/components/u-upload/u-upload.vue +6 -67
- package/components/u-verification-code/types.ts +22 -0
- package/components/u-verification-code/u-verification-code.vue +2 -32
- package/components/u-waterfall/types.ts +16 -0
- package/components/u-waterfall/u-waterfall.vue +2 -18
- package/package.json +1 -1
- package/types/global.d.ts +200 -0
|
@@ -81,217 +81,13 @@
|
|
|
81
81
|
import { ref, computed, watch, getCurrentInstance } from 'vue';
|
|
82
82
|
import { $u } from '../..';
|
|
83
83
|
import { dispatch } from '../../libs/util/emitter';
|
|
84
|
+
import { InputProps } from './types';
|
|
84
85
|
|
|
85
86
|
defineOptions({
|
|
86
87
|
name: 'u-input'
|
|
87
88
|
});
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
* input 输入框
|
|
91
|
-
* @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
|
|
92
|
-
* @tutorial http://uviewui.com/components/input.html
|
|
93
|
-
* @property {String} type 模式选择,见官网说明
|
|
94
|
-
* @property {Boolean} clearable 是否显示右侧的清除图标(默认true)
|
|
95
|
-
* @property {} v-model 用于双向绑定输入框的值
|
|
96
|
-
* @property {String} input-align 输入框文字的对齐方式(默认left)
|
|
97
|
-
* @property {String} placeholder placeholder显示值(默认 '请输入内容')
|
|
98
|
-
* @property {Boolean} disabled 是否禁用输入框(默认false)
|
|
99
|
-
* @property {String Number} maxlength 输入框的最大可输入长度(默认140)
|
|
100
|
-
* @property {String Number} selection-start 光标起始位置,自动聚焦时有效,需与selection-end搭配使用(默认-1)
|
|
101
|
-
* @property {String Number} maxlength 光标结束位置,自动聚焦时有效,需与selection-start搭配使用(默认-1)
|
|
102
|
-
* @property {String Number} cursor-spacing 指定光标与键盘的距离,单位px(默认0)
|
|
103
|
-
* @property {String} placeholderStyle placeholder的样式,字符串形式,如"color: red;"(默认 "color: #c0c4cc;")
|
|
104
|
-
* @property {String} confirm-type 设置键盘右下角按钮的文字,仅在type为text时生效(默认done)
|
|
105
|
-
* @property {Object} custom-style 自定义输入框的样式,对象形式
|
|
106
|
-
* @property {Boolean} focus 是否自动获得焦点(默认false)
|
|
107
|
-
* @property {Boolean} fixed 如果type为textarea,且在一个"position:fixed"的区域,需要指明为true(默认false)
|
|
108
|
-
* @property {Boolean} password-icon type为password时,是否显示右侧的密码查看图标(默认true)
|
|
109
|
-
* @property {Boolean} border 是否显示边框(默认false)
|
|
110
|
-
* @property {String} border-color 输入框的边框颜色(默认#dcdfe6)
|
|
111
|
-
* @property {Boolean} auto-height 是否自动增高输入区域,type为textarea时有效(默认true)
|
|
112
|
-
* @property {String Number} height 高度,单位rpx(text类型时为70,textarea时为100)
|
|
113
|
-
* @example <u-input v-model="value" :type="type" :border="border" />
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
const props = defineProps({
|
|
117
|
-
/**
|
|
118
|
-
* 用于双向绑定输入框的值
|
|
119
|
-
*/
|
|
120
|
-
modelValue: {
|
|
121
|
-
type: [String, Number],
|
|
122
|
-
default: ''
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* 输入框的类型,textarea,text,number
|
|
126
|
-
*/
|
|
127
|
-
type: {
|
|
128
|
-
type: String,
|
|
129
|
-
default: 'text'
|
|
130
|
-
},
|
|
131
|
-
/**
|
|
132
|
-
* 输入框文字的对齐方式(默认left)
|
|
133
|
-
*/
|
|
134
|
-
inputAlign: {
|
|
135
|
-
type: String,
|
|
136
|
-
default: 'left'
|
|
137
|
-
},
|
|
138
|
-
/**
|
|
139
|
-
* placeholder显示值(默认 '请输入内容')
|
|
140
|
-
*/
|
|
141
|
-
placeholder: {
|
|
142
|
-
type: String,
|
|
143
|
-
default: '请输入内容'
|
|
144
|
-
},
|
|
145
|
-
/**
|
|
146
|
-
* 是否禁用输入框(默认false)
|
|
147
|
-
*/
|
|
148
|
-
disabled: {
|
|
149
|
-
type: Boolean,
|
|
150
|
-
default: false
|
|
151
|
-
},
|
|
152
|
-
/**
|
|
153
|
-
* 输入框的最大可输入长度(默认140)
|
|
154
|
-
*/
|
|
155
|
-
maxlength: {
|
|
156
|
-
type: [Number, String],
|
|
157
|
-
default: 140
|
|
158
|
-
},
|
|
159
|
-
/**
|
|
160
|
-
* placeholder的样式,字符串形式,如"color: red;"(默认 "color: #c0c4cc;")
|
|
161
|
-
*/
|
|
162
|
-
placeholderStyle: {
|
|
163
|
-
type: String,
|
|
164
|
-
default: 'color: #c0c4cc;'
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* 设置键盘右下角按钮的文字,仅在type为text时生效(默认done)
|
|
168
|
-
*/
|
|
169
|
-
confirmType: {
|
|
170
|
-
type: String,
|
|
171
|
-
default: 'done'
|
|
172
|
-
},
|
|
173
|
-
/**
|
|
174
|
-
* 自定义输入框的样式,对象形式
|
|
175
|
-
*/
|
|
176
|
-
customStyle: {
|
|
177
|
-
type: Object,
|
|
178
|
-
default: () => ({})
|
|
179
|
-
},
|
|
180
|
-
/**
|
|
181
|
-
* 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true
|
|
182
|
-
*/
|
|
183
|
-
fixed: {
|
|
184
|
-
type: Boolean,
|
|
185
|
-
default: false
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
* 是否自动获得焦点(默认false)
|
|
189
|
-
*/
|
|
190
|
-
focus: {
|
|
191
|
-
type: Boolean,
|
|
192
|
-
default: false
|
|
193
|
-
},
|
|
194
|
-
/**
|
|
195
|
-
* 密码类型时,是否显示右侧的密码图标(默认true)
|
|
196
|
-
*/
|
|
197
|
-
passwordIcon: {
|
|
198
|
-
type: Boolean,
|
|
199
|
-
default: true
|
|
200
|
-
},
|
|
201
|
-
/**
|
|
202
|
-
* input|textarea是否显示边框(默认false)
|
|
203
|
-
*/
|
|
204
|
-
border: {
|
|
205
|
-
type: Boolean,
|
|
206
|
-
default: false
|
|
207
|
-
},
|
|
208
|
-
/**
|
|
209
|
-
* 输入框的边框颜色(默认#dcdfe6)
|
|
210
|
-
*/
|
|
211
|
-
borderColor: {
|
|
212
|
-
type: String,
|
|
213
|
-
default: '#dcdfe6'
|
|
214
|
-
},
|
|
215
|
-
/**
|
|
216
|
-
* 是否自动增高输入区域,type为textarea时有效(默认true)
|
|
217
|
-
*/
|
|
218
|
-
autoHeight: {
|
|
219
|
-
type: Boolean,
|
|
220
|
-
default: true
|
|
221
|
-
},
|
|
222
|
-
/**
|
|
223
|
-
* type=select时,旋转右侧的图标,标识当前处于打开还是关闭select的状态
|
|
224
|
-
* open-打开,close-关闭
|
|
225
|
-
*/
|
|
226
|
-
selectOpen: {
|
|
227
|
-
type: Boolean,
|
|
228
|
-
default: false
|
|
229
|
-
},
|
|
230
|
-
/**
|
|
231
|
-
* 高度,单位rpx
|
|
232
|
-
*/
|
|
233
|
-
height: {
|
|
234
|
-
type: [Number, String],
|
|
235
|
-
default: ''
|
|
236
|
-
},
|
|
237
|
-
/**
|
|
238
|
-
* 是否可清空(默认true)
|
|
239
|
-
*/
|
|
240
|
-
clearable: {
|
|
241
|
-
type: Boolean,
|
|
242
|
-
default: true
|
|
243
|
-
},
|
|
244
|
-
/**
|
|
245
|
-
* 指定光标与键盘的距离,单位 px(默认0)
|
|
246
|
-
*/
|
|
247
|
-
cursorSpacing: {
|
|
248
|
-
type: [Number, String],
|
|
249
|
-
default: 0
|
|
250
|
-
},
|
|
251
|
-
/**
|
|
252
|
-
* 光标起始位置,自动聚焦时有效,需与selection-end搭配使用(默认-1)
|
|
253
|
-
*/
|
|
254
|
-
selectionStart: {
|
|
255
|
-
type: [Number, String],
|
|
256
|
-
default: -1
|
|
257
|
-
},
|
|
258
|
-
/**
|
|
259
|
-
* 光标结束位置,自动聚焦时有效,需与selection-start搭配使用(默认-1)
|
|
260
|
-
*/
|
|
261
|
-
selectionEnd: {
|
|
262
|
-
type: [Number, String],
|
|
263
|
-
default: -1
|
|
264
|
-
},
|
|
265
|
-
/**
|
|
266
|
-
* 是否自动去除两端的空格(默认true)
|
|
267
|
-
*/
|
|
268
|
-
trim: {
|
|
269
|
-
type: Boolean,
|
|
270
|
-
default: true
|
|
271
|
-
},
|
|
272
|
-
/**
|
|
273
|
-
* 是否显示键盘上方带有”完成“按钮那一栏(默认true)
|
|
274
|
-
*/
|
|
275
|
-
showConfirmbar: {
|
|
276
|
-
type: Boolean,
|
|
277
|
-
default: true
|
|
278
|
-
},
|
|
279
|
-
/**
|
|
280
|
-
* 弹出键盘时是否自动调节高度,uni-app默认值是true
|
|
281
|
-
*/
|
|
282
|
-
adjustPosition: {
|
|
283
|
-
type: Boolean,
|
|
284
|
-
default: true
|
|
285
|
-
},
|
|
286
|
-
/**
|
|
287
|
-
* 输入框的验证状态,用于错误时,边框是否改为红色
|
|
288
|
-
*/
|
|
289
|
-
validateState: {
|
|
290
|
-
type: Boolean,
|
|
291
|
-
default: false
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
|
|
90
|
+
const props = defineProps(InputProps);
|
|
295
91
|
const emit = defineEmits(['update:modelValue', 'blur', 'focus', 'confirm', 'click']);
|
|
296
92
|
|
|
297
93
|
const defaultValue = ref(props.modelValue);
|
|
@@ -336,7 +132,6 @@ const uSelectionStart = computed(() => String(props.selectionStart));
|
|
|
336
132
|
// 光标结束位置
|
|
337
133
|
const uSelectionEnd = computed(() => String(props.selectionEnd));
|
|
338
134
|
|
|
339
|
-
// 事件派发工具
|
|
340
135
|
const instance = getCurrentInstance();
|
|
341
136
|
|
|
342
137
|
// 监听u-form-item发出的错误事件,将输入框边框变红色,失效了
|
|
@@ -349,7 +144,6 @@ function handleInput(event: any) {
|
|
|
349
144
|
let value = event.detail.value;
|
|
350
145
|
// 判断是否去除空格
|
|
351
146
|
if (props.trim) value = $u.trim(value);
|
|
352
|
-
// vue 原生的方法 return 出去
|
|
353
147
|
emit('update:modelValue', value);
|
|
354
148
|
// 当前model 赋值
|
|
355
149
|
defaultValue.value = value;
|
|
@@ -378,7 +172,6 @@ function handleBlur(event: any) {
|
|
|
378
172
|
setTimeout(() => {
|
|
379
173
|
focused.value = false;
|
|
380
174
|
}, 100);
|
|
381
|
-
// vue 原生的方法 return 出去
|
|
382
175
|
emit('blur', value);
|
|
383
176
|
setTimeout(() => {
|
|
384
177
|
// 头条小程序由于自身bug,导致中文下,每按下一个键(尚未完成输入),都会触发一次@input,导致错误,这里进行判断处理
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* u-keyboard 组件 Props 类型定义
|
|
5
|
+
* @description 自定义键盘面板属性
|
|
6
|
+
*/
|
|
7
|
+
export const KeyboardProps = {
|
|
8
|
+
/** 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘 */
|
|
9
|
+
mode: { type: String, default: 'number' },
|
|
10
|
+
/** 是否显示键盘的"."符号 */
|
|
11
|
+
dotEnabled: { type: Boolean, default: true },
|
|
12
|
+
/** 是否显示顶部工具条 */
|
|
13
|
+
tooltip: { type: Boolean, default: true },
|
|
14
|
+
/** 是否显示工具条中间的提示 */
|
|
15
|
+
showTips: { type: Boolean, default: true },
|
|
16
|
+
/** 工具条中间的提示文字 */
|
|
17
|
+
tips: { type: String, default: '' },
|
|
18
|
+
/** 是否显示工具条左边的"取消"按钮 */
|
|
19
|
+
cancelBtn: { type: Boolean, default: true },
|
|
20
|
+
/** 是否显示工具条右边的"完成"按钮 */
|
|
21
|
+
confirmBtn: { type: Boolean, default: true },
|
|
22
|
+
/** 是否打乱键盘按键的顺序 */
|
|
23
|
+
random: { type: Boolean, default: false },
|
|
24
|
+
/** 是否开启底部安全区适配 */
|
|
25
|
+
safeAreaInsetBottom: { type: Boolean, default: false },
|
|
26
|
+
/** 是否允许通过点击遮罩关闭键盘 */
|
|
27
|
+
maskCloseAble: { type: Boolean, default: true },
|
|
28
|
+
/** 通过双向绑定控制键盘的弹出与收起 */
|
|
29
|
+
modelValue: { type: Boolean, default: false },
|
|
30
|
+
/** 是否显示遮罩 */
|
|
31
|
+
mask: { type: Boolean, default: true },
|
|
32
|
+
/** z-index值 */
|
|
33
|
+
zIndex: { type: [Number, String] as PropType<string | number>, default: '' },
|
|
34
|
+
/** 取消按钮的文字 */
|
|
35
|
+
cancelText: { type: String, default: '取消' },
|
|
36
|
+
/** 确认按钮的文字 */
|
|
37
|
+
confirmText: { type: String, default: '确认' }
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type KeyboardProps = ExtractPropTypes<typeof KeyboardProps>;
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script setup lang="ts">
|
|
35
|
+
import { KeyboardProps } from './types';
|
|
35
36
|
import { computed } from 'vue';
|
|
36
37
|
|
|
37
38
|
defineOptions({
|
|
@@ -62,38 +63,7 @@ defineOptions({
|
|
|
62
63
|
* @example <u-keyboard mode="number" v-model="show"></u-keyboard>
|
|
63
64
|
*/
|
|
64
65
|
|
|
65
|
-
const props = defineProps(
|
|
66
|
-
/** 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘 */
|
|
67
|
-
mode: { type: String, default: 'number' },
|
|
68
|
-
/** 是否显示键盘的"."符号 */
|
|
69
|
-
dotEnabled: { type: Boolean, default: true },
|
|
70
|
-
/** 是否显示顶部工具条 */
|
|
71
|
-
tooltip: { type: Boolean, default: true },
|
|
72
|
-
/** 是否显示工具条中间的提示 */
|
|
73
|
-
showTips: { type: Boolean, default: true },
|
|
74
|
-
/** 工具条中间的提示文字 */
|
|
75
|
-
tips: { type: String, default: '' },
|
|
76
|
-
/** 是否显示工具条左边的"取消"按钮 */
|
|
77
|
-
cancelBtn: { type: Boolean, default: true },
|
|
78
|
-
/** 是否显示工具条右边的"完成"按钮 */
|
|
79
|
-
confirmBtn: { type: Boolean, default: true },
|
|
80
|
-
/** 是否打乱键盘按键的顺序 */
|
|
81
|
-
random: { type: Boolean, default: false },
|
|
82
|
-
/** 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距 */
|
|
83
|
-
safeAreaInsetBottom: { type: Boolean, default: false },
|
|
84
|
-
/** 是否允许通过点击遮罩关闭键盘 */
|
|
85
|
-
maskCloseAble: { type: Boolean, default: true },
|
|
86
|
-
/** 通过双向绑定控制键盘的弹出与收起 */
|
|
87
|
-
modelValue: { type: Boolean, default: false },
|
|
88
|
-
/** 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩 */
|
|
89
|
-
mask: { type: Boolean, default: true },
|
|
90
|
-
/** z-index值 */
|
|
91
|
-
zIndex: { type: [Number, String], default: '' },
|
|
92
|
-
/** 取消按钮的文字 */
|
|
93
|
-
cancelText: { type: String, default: '取消' },
|
|
94
|
-
/** 确认按钮的文字 */
|
|
95
|
-
confirmText: { type: String, default: '确认' }
|
|
96
|
-
});
|
|
66
|
+
const props = defineProps(KeyboardProps);
|
|
97
67
|
const emit = defineEmits(['change', 'update:modelValue', 'confirm', 'cancel', 'backspace']);
|
|
98
68
|
|
|
99
69
|
const uZIndex = computed(() => (props.zIndex ? props.zIndex : 1075));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { Effect, ImgMode } from '../../types/global';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* u-lazy-load 组件 Props 类型定义
|
|
6
|
+
* @description 懒加载图片组件属性
|
|
7
|
+
*/
|
|
8
|
+
export const LazyLoadProps = {
|
|
9
|
+
/** 用户自定义值,在事件触发时回调,用以区分是哪个图片 */
|
|
10
|
+
index: [Number, String],
|
|
11
|
+
/** 要显示的图片 */
|
|
12
|
+
image: { type: String, default: '' },
|
|
13
|
+
/** 图片裁剪模式 */
|
|
14
|
+
imgMode: { type: String as PropType<ImgMode>, default: 'widthFix' },
|
|
15
|
+
/** 占位图片路径 */
|
|
16
|
+
loadingImg: {
|
|
17
|
+
type: String,
|
|
18
|
+
default:
|
|
19
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5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IEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiAALELvqt/BBgACqVeUBXxcCkAAAAASUVORK5CYII='
|
|
20
|
+
},
|
|
21
|
+
/** 加载失败的错误占位图 */
|
|
22
|
+
errorImg: { type: String },
|
|
23
|
+
/** 图片进入可见区域前多少像素时,单位rpx,开始加载图片 */
|
|
24
|
+
threshold: { type: [String, Number] as PropType<string | number>, default: 100 },
|
|
25
|
+
/** 淡入淡出动画的过渡时间 */
|
|
26
|
+
duration: { type: [String, Number] as PropType<string | number>, default: 500 },
|
|
27
|
+
/** 渡效果的速度曲线 */
|
|
28
|
+
effect: { type: String as PropType<Effect>, default: 'ease-in-out' },
|
|
29
|
+
/** 是否使用过渡效果 */
|
|
30
|
+
isEffect: { type: Boolean, default: true },
|
|
31
|
+
/** 圆角值 */
|
|
32
|
+
borderRadius: { type: [String, Number] as PropType<string | number>, default: 0 },
|
|
33
|
+
/** 图片高度,单位rpx */
|
|
34
|
+
height: { type: [String, Number] as PropType<string | number>, default: 450 }
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type LazyLoadProps = ExtractPropTypes<typeof LazyLoadProps>;
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup lang="ts">
|
|
37
|
+
import { LazyLoadProps } from './types';
|
|
37
38
|
import { ref, computed, watch, onMounted, nextTick, getCurrentInstance } from 'vue';
|
|
38
39
|
import { $u } from '../..';
|
|
39
40
|
|
|
@@ -62,64 +63,8 @@ defineOptions({ name: 'u-lazy-load' });
|
|
|
62
63
|
|
|
63
64
|
const emit = defineEmits(['click', 'load', 'error']);
|
|
64
65
|
|
|
65
|
-
const props = defineProps(
|
|
66
|
-
|
|
67
|
-
index: [Number, String],
|
|
68
|
-
/** 要显示的图片 */
|
|
69
|
-
image: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: ''
|
|
72
|
-
},
|
|
73
|
-
/** 图片裁剪模式 */
|
|
74
|
-
imgMode: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: 'widthFix'
|
|
77
|
-
},
|
|
78
|
-
/** 占位图片路径 */
|
|
79
|
-
loadingImg: {
|
|
80
|
-
type: String,
|
|
81
|
-
default:
|
|
82
|
-
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1zbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1zbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9Inh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G+Vk/IDr34DSNR7huZJkMFT6vEhqrPx/j5cnlZML8N6/PAzh9Y99Flm5Yde/c9BquDOkvkKkMP58dA4qi9vivE8JOvGz/j8FokfPpr288+pH2ZPOZrLmeGD+7KOh6dqYWJ48ki7yUg0tz0go/fv/LLddfV3sgOLJyaGPY/zrSlh1a36Arkzoue9CyG35ze6E6/dzO2Ga0EGHqdRJIkfn9/8OEjTW8Vq91ZWh39FeehWA7Nu9ft8CpUEk1WWOyDF0OPyEU2Pnzf/bZC0P6IPzmAvu7KauQBVrgKpJ0tG2arHzX8e5Pb3PezNs/PrX+3JMyCLn9XXf37tPFHvt09WfCDDjx+yyn1/p1V11j7GnB/q3leLuVva79S/tzed+db08YpF4uOZtmz/9oXWMq6BCAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiAALELvqt/BBgACqVeUBXxcCkAAAAASUVORK5CYII='
|
|
83
|
-
},
|
|
84
|
-
// 加载失败的错误占位图
|
|
85
|
-
errorImg: {
|
|
86
|
-
type: String,
|
|
87
|
-
default:
|
|
88
|
-
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6b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ATpjJ2JSt/POIvU9wPJEs/jduJAjLvU0yFT0i64Yb1bsVi79dA4pEy3TzoHMq2O7Re4vXm5O9+l290NpE4CU+YRIMNye2iaqbVS2AUnn2fsekthYKReVNutVedA5juttyIXrT38mOds+ps9DWhwL7GWc61/DVKPzVN9UHDarf1icU98IOU8tm6L031Iq63t1tKzj3fe/FCpO4F0/i0Z2+yvA1KeGBjqj1qYx8/zoxpKZ1Yl367I1k+sfcft/QPy9csXy/32qX1qLZsrryG5BGQaRj0vc/b7N54XXq293TCLB5HO42Fy517obW19b+qjl3CHp0fdLJcWvmdy1etESi/uAdJrs1hTaUklHuW8qSDdC3UfXVR5cnD3rAFSSqtFb7z7eapErx7rC739jCXfbK3aWiipjXo8UbmxXPa7QQq9R289j2Gr88N7Ag5AlHPRKc37pNZv0CZtX1tVMG6rm8qW1/KlCgQvcMss933ybwXZz3dReW5yce4ByZtHFIhwT9kmjxg8BzbKDUe1PB9edBJqSN7/KM1LmqyuMZ5BpeTUw1aD/uDI0relPfSHa/Wn8Pxq1BNfxy/h3IdwOJqIKumb9CHvTqMefyY82RoQAgggBBBACCCAEEAAIYAQQAAhgABCAAGEAAIIAYQAAggBBBACCCAEEEAIIAQQQAgggBBAACGAAEIAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAIIIAQQAAhgABCAAGEAEIAAYQAAggBBBACCCAEEAIIIAQQQAgggBBAACGAEEAAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAIIIAQQAAhgABCAAGEAEIAAYQAAggBBBACCCAEEAIIIAQQQAgggBBAACGAEEAAIYAAQgABhAACCAGEAAIIAQQQAgggBBBACCAEEEAIIIAQQAAhgABCACGAAEIAAYQAAggBBBACCAEEEAIIIAQQQAggfyL/BBgA8PgLdH0TBtkAAAAASUVORK5CYII='
|
|
89
|
-
},
|
|
90
|
-
/** 图片进入可见区域前多少像素时,单位rpx,开始加载图片 */
|
|
91
|
-
/** 负数为图片超出屏幕底部多少距离后触发懒加载,正数为图片顶部距离屏幕底部多少距离时触发(图片还没出现在屏幕上) */
|
|
92
|
-
threshold: {
|
|
93
|
-
type: [Number, String],
|
|
94
|
-
default: 100
|
|
95
|
-
},
|
|
96
|
-
/** 淡入淡出动画的过渡时间 */
|
|
97
|
-
duration: {
|
|
98
|
-
type: [Number, String],
|
|
99
|
-
default: 500
|
|
100
|
-
},
|
|
101
|
-
/** 渡效果的速度曲线,各个之间差别不大,因为这是淡入淡出,且时间很短,不是那些变形或者移动的情况,会明显 */
|
|
102
|
-
/** linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(n,n,n,n); */
|
|
103
|
-
effect: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: 'ease-in-out'
|
|
106
|
-
},
|
|
107
|
-
/** 是否使用过渡效果 */
|
|
108
|
-
isEffect: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: true
|
|
111
|
-
},
|
|
112
|
-
/** 圆角值 */
|
|
113
|
-
borderRadius: {
|
|
114
|
-
type: [Number, String],
|
|
115
|
-
default: 0
|
|
116
|
-
},
|
|
117
|
-
/** 图片高度,单位rpx */
|
|
118
|
-
height: {
|
|
119
|
-
type: [Number, String],
|
|
120
|
-
default: '450'
|
|
121
|
-
}
|
|
122
|
-
});
|
|
66
|
+
const props = defineProps(LazyLoadProps);
|
|
67
|
+
|
|
123
68
|
const instance = getCurrentInstance();
|
|
124
69
|
// 懒加载相关响应式变量
|
|
125
70
|
const isShow = ref(false);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { LineBorderStyle, LineDirection } from '../../types/global';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* u-line 组件 props 类型定义
|
|
6
|
+
* @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单
|
|
7
|
+
*/
|
|
8
|
+
export const LineProps = {
|
|
9
|
+
/** 线条的颜色 */
|
|
10
|
+
color: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '#e4e7ed'
|
|
13
|
+
},
|
|
14
|
+
/** 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等 */
|
|
15
|
+
length: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '100%'
|
|
18
|
+
},
|
|
19
|
+
/** 线条方向,col-竖向,row-横向 */
|
|
20
|
+
direction: {
|
|
21
|
+
type: String as PropType<LineDirection>,
|
|
22
|
+
default: 'row'
|
|
23
|
+
},
|
|
24
|
+
/** 是否显示细边框 */
|
|
25
|
+
hairLine: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
/** 线条与上下左右元素的间距,字符串形式,如"30rpx"、"20rpx 30rpx" */
|
|
30
|
+
margin: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '0'
|
|
33
|
+
},
|
|
34
|
+
/** 线条的类型,solid-实线,dashed-方形虚线,dotted-圆点虚线 */
|
|
35
|
+
borderStyle: {
|
|
36
|
+
type: String as PropType<LineBorderStyle>,
|
|
37
|
+
default: 'solid'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* u-line 组件 props 类型
|
|
43
|
+
*/
|
|
44
|
+
export type LineProps = ExtractPropTypes<typeof LineProps>;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
6
|
import { computed } from 'vue';
|
|
7
7
|
import { $u } from '../..';
|
|
8
|
+
import { LineProps } from './types';
|
|
8
9
|
|
|
9
10
|
defineOptions({
|
|
10
11
|
name: 'u-line'
|
|
@@ -22,20 +23,7 @@ defineOptions({
|
|
|
22
23
|
* @property {String} margin 线条与上下左右元素的间距,字符串形式,如"30rpx"
|
|
23
24
|
* @example <u-line color="red"></u-line>
|
|
24
25
|
*/
|
|
25
|
-
const props = defineProps(
|
|
26
|
-
/** 线条的颜色 */
|
|
27
|
-
color: { type: String, default: '#e4e7ed' },
|
|
28
|
-
/** 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等 */
|
|
29
|
-
length: { type: String, default: '100%' },
|
|
30
|
-
/** 线条方向,col-竖向,row-横向 */
|
|
31
|
-
direction: { type: String, default: 'row' },
|
|
32
|
-
/** 是否显示细边框 */
|
|
33
|
-
hairLine: { type: Boolean, default: true },
|
|
34
|
-
/** 线条与上下左右元素的间距,字符串形式,如"30rpx"、"20rpx 30rpx" */
|
|
35
|
-
margin: { type: String, default: '0' },
|
|
36
|
-
/** 线条的类型,solid-实线,dashed-方形虚线,dotted-圆点虚线 */
|
|
37
|
-
borderStyle: { type: String, default: 'solid' }
|
|
38
|
-
});
|
|
26
|
+
const props = defineProps(LineProps);
|
|
39
27
|
|
|
40
28
|
/**
|
|
41
29
|
* 线条样式
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* u-line-progress 组件 props 类型定义
|
|
5
|
+
* @description 线型进度条,支持多种样式
|
|
6
|
+
*/
|
|
7
|
+
export const LineProgressProps = {
|
|
8
|
+
/** 两端是否显示半圆形 */
|
|
9
|
+
round: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: true
|
|
12
|
+
},
|
|
13
|
+
/** 主题颜色 */
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ''
|
|
17
|
+
},
|
|
18
|
+
/** 激活部分的颜色 */
|
|
19
|
+
activeColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '#19be6b'
|
|
22
|
+
},
|
|
23
|
+
/** 进度条的底色 */
|
|
24
|
+
inactiveColor: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '#ececec'
|
|
27
|
+
},
|
|
28
|
+
/** 进度百分比,数值 */
|
|
29
|
+
percent: {
|
|
30
|
+
type: [Number, String] as PropType<number | string>,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
/** 是否在进度条内部显示百分比的值 */
|
|
34
|
+
showPercent: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
/** 进度条的高度,单位rpx */
|
|
39
|
+
height: {
|
|
40
|
+
type: [Number, String] as PropType<number | string>,
|
|
41
|
+
default: 28
|
|
42
|
+
},
|
|
43
|
+
/** 是否显示条纹 */
|
|
44
|
+
striped: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
/** 条纹是否显示活动状态 */
|
|
49
|
+
stripedActive: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* u-line-progress 组件 props 类型
|
|
57
|
+
*/
|
|
58
|
+
export type LineProgressProps = ExtractPropTypes<typeof LineProgressProps>;
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
20
|
import { computed, useSlots } from 'vue';
|
|
21
|
+
import { LineProgressProps } from './types';
|
|
21
22
|
|
|
22
23
|
defineOptions({
|
|
23
24
|
name: 'u-line-progress'
|
|
@@ -38,27 +39,7 @@ defineOptions({
|
|
|
38
39
|
* @property {Boolean} striped-active 条纹是否具有动态效果(默认false)
|
|
39
40
|
* @example <u-line-progress :percent="70" :show-percent="true"></u-line-progress>
|
|
40
41
|
*/
|
|
41
|
-
const props = defineProps(
|
|
42
|
-
/** 两端是否显示半圆形 */
|
|
43
|
-
round: { type: Boolean, default: true },
|
|
44
|
-
/** 主题颜色 */
|
|
45
|
-
type: { type: String, default: '' },
|
|
46
|
-
/** 激活部分的颜色 */
|
|
47
|
-
activeColor: { type: String, default: '#19be6b' },
|
|
48
|
-
/** 进度条的底色 */
|
|
49
|
-
inactiveColor: { type: String, default: '#ececec' },
|
|
50
|
-
/** 进度百分比,数值 */
|
|
51
|
-
percent: { type: Number, default: 0 },
|
|
52
|
-
/** 是否在进度条内部显示百分比的值 */
|
|
53
|
-
showPercent: { type: Boolean, default: true },
|
|
54
|
-
/** 进度条的高度,单位rpx */
|
|
55
|
-
height: { type: [Number, String], default: 28 },
|
|
56
|
-
/** 是否显示条纹 */
|
|
57
|
-
striped: { type: Boolean, default: false },
|
|
58
|
-
/** 条纹是否显示活动状态 */
|
|
59
|
-
stripedActive: { type: Boolean, default: false }
|
|
60
|
-
});
|
|
61
|
-
|
|
42
|
+
const props = defineProps(LineProgressProps);
|
|
62
43
|
const slots = useSlots();
|
|
63
44
|
|
|
64
45
|
/**
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* u-link 组件 props 类型定义
|
|
5
|
+
* @description 超链接组件,支持多端跳转/复制/提示
|
|
6
|
+
*/
|
|
7
|
+
export const LinkProps = {
|
|
8
|
+
/** 文字颜色 */
|
|
9
|
+
color: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '#2979ff'
|
|
12
|
+
},
|
|
13
|
+
/** 字体大小,单位rpx */
|
|
14
|
+
fontSize: {
|
|
15
|
+
type: [String, Number] as PropType<string | number>,
|
|
16
|
+
default: 28
|
|
17
|
+
},
|
|
18
|
+
/** 是否显示下划线 */
|
|
19
|
+
underLine: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
/** 要跳转的链接 */
|
|
24
|
+
href: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
/** 小程序中复制到粘贴板的提示语 */
|
|
29
|
+
mpTips: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '链接已复制,请在浏览器打开'
|
|
32
|
+
},
|
|
33
|
+
/** 下划线颜色 */
|
|
34
|
+
lineColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* u-link 组件 props 类型
|
|
42
|
+
*/
|
|
43
|
+
export type LinkProps = ExtractPropTypes<typeof LinkProps>;
|