uview-pro 0.0.5 → 0.0.7

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.
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /**
2
3
  * we-cropper v1.3.9
3
4
  * (c) 2020 dlhandsome
@@ -187,6 +187,7 @@ const vertical = computed(() => {
187
187
  const computeBgColor = computed(() => {
188
188
  if (props.bgColor) return props.bgColor;
189
189
  else if (props.type === 'none') return 'transparent';
190
+ else return '';
190
191
  });
191
192
 
192
193
  /**
@@ -223,6 +224,7 @@ function change(e: { detail: { current: number } }) {
223
224
 
224
225
  <style lang="scss" scoped>
225
226
  @import '../../libs/css/style.components.scss';
227
+
226
228
  .u-notice-bar {
227
229
  width: 100%;
228
230
  @include vue-flex;
@@ -232,6 +234,7 @@ function change(e: { detail: { current: number } }) {
232
234
  padding: 18rpx 24rpx;
233
235
  overflow: hidden;
234
236
  }
237
+
235
238
  .u-swiper {
236
239
  font-size: 26rpx;
237
240
  height: 32rpx;
@@ -240,14 +243,17 @@ function change(e: { detail: { current: number } }) {
240
243
  flex: 1;
241
244
  margin-left: 12rpx;
242
245
  }
246
+
243
247
  .u-swiper-item {
244
248
  @include vue-flex;
245
249
  align-items: center;
246
250
  overflow: hidden;
247
251
  }
252
+
248
253
  .u-news-item {
249
254
  overflow: hidden;
250
255
  }
256
+
251
257
  .u-right-icon {
252
258
  margin-left: 12rpx;
253
259
  /* #ifndef APP-NVUE */
@@ -255,6 +261,7 @@ function change(e: { detail: { current: number } }) {
255
261
  /* #endif */
256
262
  align-items: center;
257
263
  }
264
+
258
265
  .u-left-icon {
259
266
  /* #ifndef APP-NVUE */
260
267
  display: inline-flex;
@@ -111,31 +111,31 @@ const props = defineProps({
111
111
  * @default '#606266'
112
112
  */
113
113
  labelColor: { type: String, default: '#606266' },
114
- /**
115
- * label与图标的距离(横向排列),单位rpx(默认6)
116
- * @default '6'
117
- */
118
- marginLeft: { type: [String, Number], default: '6' },
119
- /**
120
- * label与图标的距离(竖向排列),单位rpx(默认6)
121
- * @default '6'
122
- */
123
- marginTop: { type: [String, Number], default: '6' },
124
- /**
125
- * label与图标的距离(竖向排列),单位rpx(默认6)
126
- * @default '6'
127
- */
128
- marginRight: { type: [String, Number], default: '6' },
129
- /**
130
- * label与图标的距离(竖向排列),单位rpx(默认6)
131
- * @default '6'
132
- */
133
- marginBottom: { type: [String, Number], default: '6' },
114
+ /**
115
+ * label与图标的距离(横向排列),单位rpx(默认6)
116
+ * @default '6'
117
+ */
118
+ marginLeft: { type: [String, Number], default: '6' },
119
+ /**
120
+ * label与图标的距离(竖向排列),单位rpx(默认6)
121
+ * @default '6'
122
+ */
123
+ marginTop: { type: [String, Number], default: '6' },
124
+ /**
125
+ * label与图标的距离(竖向排列),单位rpx(默认6)
126
+ * @default '6'
127
+ */
128
+ marginRight: { type: [String, Number], default: '6' },
129
+ /**
130
+ * label与图标的距离(竖向排列),单位rpx(默认6)
131
+ * @default '6'
132
+ */
133
+ marginBottom: { type: [String, Number], default: '6' },
134
134
  /**
135
135
  * label与图标的距离,单位rpx,权重高于 margin
136
136
  * @default ''
137
137
  */
138
- space: { type: [String, Number], default: '' },
138
+ space: { type: [String, Number], default: '' },
139
139
  /**
140
140
  * 图片的mode,参考uni-app image组件
141
141
  * @default 'widthFix'
@@ -78,6 +78,8 @@ const numList = computed(() => {
78
78
  return $u.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, cardX, 0]);
79
79
  }
80
80
  }
81
+ // 默认返回数字键盘
82
+ return [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
81
83
  });
82
84
 
83
85
  /**
@@ -2,9 +2,9 @@
2
2
  <view class="u-rate" :id="elId" @touchmove.stop.prevent="touchMove">
3
3
  <view class="u-star-wrap" v-for="(item, index) in count" :key="index" :class="[elClass]">
4
4
  <u-icon
5
- :name="activeIndex > index ? elActiveIcon : inactiveIcon"
5
+ :name="String(activeIndex > index ? elActiveIcon : inactiveIcon)"
6
6
  @click="click(index + 1, $event)"
7
- :color="activeIndex > index ? elActiveColor : inactiveColor"
7
+ :color="String(activeIndex > index ? elActiveColor : inactiveColor)"
8
8
  :custom-style="{
9
9
  fontSize: size + 'rpx',
10
10
  padding: `0 ${Number(gutter) / 2 + 'rpx'}`
@@ -197,10 +197,17 @@ watch(
197
197
  /**
198
198
  * 计算当前星星的显示小数部分(半星)
199
199
  */
200
- const decimal = computed(() => {
200
+ const decimal = computed((): number => {
201
201
  if (props.disabled) {
202
- return (Number(activeIndex.value) * 100) % 100;
202
+ // 只在允许半星时才返回小数部分,否则始终为0
203
+ if (props.allowHalf) {
204
+ // 计算当前激活星星的小数部分(如3.5星,返回50)
205
+ const val = Number(activeIndex.value);
206
+ return (val - Math.floor(val)) * 100;
207
+ }
208
+ return 0;
203
209
  } else if (props.allowHalf) {
210
+ // 允许半星时,返回50,否则0
204
211
  return 50;
205
212
  }
206
213
  return 0;
@@ -147,6 +147,7 @@ const textStyle = computed(() => {
147
147
  const computeBgColor = computed(() => {
148
148
  if (props.bgColor) return props.bgColor;
149
149
  else if (props.type === 'none') return 'transparent';
150
+ else return '';
150
151
  });
151
152
 
152
153
  /**
@@ -223,32 +224,38 @@ function getMore() {
223
224
 
224
225
  <style lang="scss" scoped>
225
226
  @import '../../libs/css/style.components.scss';
227
+
226
228
  .u-notice-bar {
227
229
  padding: 18rpx 24rpx;
228
230
  overflow: hidden;
229
231
  }
232
+
230
233
  .u-direction-row {
231
234
  @include vue-flex;
232
235
  align-items: center;
233
236
  justify-content: space-between;
234
237
  }
238
+
235
239
  .u-left-icon {
236
240
  /* #ifndef APP-NVUE */
237
241
  display: inline-flex;
238
242
  /* #endif */
239
243
  align-items: center;
240
244
  }
245
+
241
246
  .u-notice-box {
242
247
  flex: 1;
243
248
  @include vue-flex;
244
249
  overflow: hidden;
245
250
  margin-left: 12rpx;
246
251
  }
252
+
247
253
  .u-right-icon {
248
254
  margin-left: 12rpx;
249
255
  display: inline-flex;
250
256
  align-items: center;
251
257
  }
258
+
252
259
  .u-notice-content {
253
260
  animation: u-loop-animation 10s linear infinite both;
254
261
  text-align: right;
@@ -257,15 +264,18 @@ function getMore() {
257
264
  @include vue-flex;
258
265
  flex-wrap: nowrap;
259
266
  }
267
+
260
268
  .u-notice-text {
261
269
  font-size: 26rpx;
262
270
  word-break: keep-all;
263
271
  white-space: nowrap;
264
272
  }
273
+
265
274
  @keyframes u-loop-animation {
266
275
  0% {
267
276
  transform: translate3d(0, 0, 0);
268
277
  }
278
+
269
279
  100% {
270
280
  transform: translate3d(-100%, 0, 0);
271
281
  }
@@ -35,7 +35,8 @@
35
35
  ></view>
36
36
  </view>
37
37
  <!-- 这里加上一个48rpx的高度,是为了增高有凸起按钮时的防塌陷高度(也即按钮凸出来部分的高度) -->
38
- <view class="u-fixed-placeholder safe-area-inset-bottom" :style="{ height: `calc(${$u.addUnit(props.height)} + ${props.midButton ? 48 : 0}rpx)` }"></view>
38
+ <!-- calc 计算0时单位不一致会计算失败,这里+1px -->
39
+ <view class="u-fixed-placeholder safe-area-inset-bottom" :style="{ height: `calc(${$u.addUnit(props.height)} + ${props.midButton ? '48rpx' : '1px'})` }"></view>
39
40
  </view>
40
41
  </template>
41
42
 
@@ -261,6 +262,7 @@ function getMidButtonLeft() {
261
262
  /* #ifndef APP-NVUE */
262
263
  box-sizing: content-box;
263
264
  /* #endif */
265
+ height: 50px;
264
266
  }
265
267
  .u-tabbar {
266
268
  &__content {
@@ -56,7 +56,7 @@ function hexToRgb(sColor: string, str: boolean = true): [number, number, number]
56
56
  }
57
57
 
58
58
  /**
59
- * rgb表示方式转换为hex表示方式
59
+ * rgbhex
60
60
  * @param rgb rgb字符串或hex字符串
61
61
  * @returns hex字符串
62
62
  */
@@ -88,6 +88,8 @@ function rgbToHex(rgb: string): string | undefined {
88
88
  } else {
89
89
  return rgb;
90
90
  }
91
+ // 默认返回原始值
92
+ return rgb;
91
93
  }
92
94
 
93
95
  /**
@@ -0,0 +1,62 @@
1
+ /**
2
+ * async-validator 类型声明文件
3
+ * 适用于 uView Pro 内置 async-validator.js
4
+ * 支持 Schema、规则、校验回调、辅助类型等
5
+ */
6
+
7
+ declare type ValidateError = {
8
+ message: string;
9
+ field?: string;
10
+ [key: string]: any;
11
+ };
12
+
13
+ declare type ValidateCallback = (errors?: ValidateError[] | null, fields?: Record<string, ValidateError[]> | null) => void;
14
+
15
+ declare interface ValidateRule {
16
+ type?: string;
17
+ required?: boolean;
18
+ message?: string;
19
+ validator?: (
20
+ rule: ValidateRule,
21
+ value: any,
22
+ callback: ValidateCallback,
23
+ source: Record<string, any>,
24
+ options: ValidateOptions
25
+ ) => void | boolean | string | Error | string[] | Promise<any>;
26
+ asyncValidator?: (rule: ValidateRule, value: any, callback: ValidateCallback, source: Record<string, any>, options: ValidateOptions) => Promise<any>;
27
+ enum?: any[];
28
+ len?: number;
29
+ min?: number;
30
+ max?: number;
31
+ pattern?: RegExp | string;
32
+ whitespace?: boolean;
33
+ fields?: Record<string, ValidateRule | ValidateRule[]>;
34
+ defaultField?: ValidateRule | ValidateRule[];
35
+ transform?: (value: any) => any;
36
+ [key: string]: any;
37
+ }
38
+
39
+ declare interface ValidateOptions {
40
+ messages?: Record<string, any>;
41
+ suppressWarning?: boolean;
42
+ first?: boolean;
43
+ firstFields?: boolean | string[];
44
+ keys?: string[];
45
+ error?: (rule: ValidateRule, msg: string) => ValidateError;
46
+ [key: string]: any;
47
+ }
48
+
49
+ declare class Schema {
50
+ constructor(descriptor: Record<string, ValidateRule | ValidateRule[]>);
51
+ messages(messages?: Record<string, any>): Record<string, any>;
52
+ define(rules: Record<string, ValidateRule | ValidateRule[]>): void;
53
+ validate(source: Record<string, any>, options?: ValidateOptions | ValidateCallback, callback?: ValidateCallback): Promise<void>;
54
+ getType(rule: ValidateRule): string;
55
+ getValidationMethod(rule: ValidateRule): Function | false;
56
+ static register(type: string, validator: Function): void;
57
+ static warning: (...args: any[]) => void;
58
+ static messages: Record<string, any>;
59
+ }
60
+
61
+ export = Schema;
62
+ export as namespace Schema;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
- "displayName": "uView Pro是uni-app全面支持Vue3+TS的uni-app生态框架,70+精选组件",
5
- "version": "0.0.5",
6
- "description": "uView Pro,是uni-app全面支持Vue3的uni-app生态框架,70+精选组件已使用TypeScript重构,已全面支持uni-app Vue3.0",
4
+ "displayName": "uView Pro 基于Vue3+TS全面重构的UI组件库,拥有70+精选组件",
5
+ "version": "0.0.7",
6
+ "description": "uView Pro,是全面支持Vue3的uni-app生态框架,70+精选组件已使用TypeScript重构,已全面支持uni-app Vue3.0",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",
9
9
  "browser": "index.ts",
@@ -58,8 +58,6 @@
58
58
  "app-vue": "y",
59
59
  "app-nvue": "n",
60
60
  "app-uvue": "n",
61
- "app-android": "y",
62
- "app-ios": "y",
63
61
  "app-harmony": "u"
64
62
  },
65
63
  "H5-mobile": {
@@ -0,0 +1,94 @@
1
+ declare module 'vue' {
2
+ export interface GlobalComponents {
3
+ // 基础组件
4
+ uActionSheet: typeof import('../components/u-action-sheet/u-action-sheet.vue')['default'];
5
+ uAlertTips: typeof import('../components/u-alert-tips/u-alert-tips.vue')['default'];
6
+ uAvatar: typeof import('../components/u-avatar/u-avatar.vue')['default'];
7
+ uAvatarCropper: typeof import('../components/u-avatar-cropper/u-avatar-cropper.vue')['default'];
8
+ uBackTop: typeof import('../components/u-back-top/u-back-top.vue')['default'];
9
+ uBadge: typeof import('../components/u-badge/u-badge.vue')['default'];
10
+ uButton: typeof import('../components/u-button/u-button.vue')['default'];
11
+ uCalendar: typeof import('../components/u-calendar/u-calendar.vue')['default'];
12
+ uCard: typeof import('../components/u-card/u-card.vue')['default'];
13
+ uCarKeyboard: typeof import('../components/u-car-keyboard/u-car-keyboard.vue')['default'];
14
+ uCellGroup: typeof import('../components/u-cell-group/u-cell-group.vue')['default'];
15
+ uCellItem: typeof import('../components/u-cell-item/u-cell-item.vue')['default'];
16
+ uCheckbox: typeof import('../components/u-checkbox/u-checkbox.vue')['default'];
17
+ uCheckboxGroup: typeof import('../components/u-checkbox-group/u-checkbox-group.vue')['default'];
18
+ uCircleProgress: typeof import('../components/u-circle-progress/u-circle-progress.vue')['default'];
19
+ uCitySelect: typeof import('../components/u-city-select/u-city-select.vue')['default'];
20
+ uCol: typeof import('../components/u-col/u-col.vue')['default'];
21
+ uCollapse: typeof import('../components/u-collapse/u-collapse.vue')['default'];
22
+ uCollapseItem: typeof import('../components/u-collapse-item/u-collapse-item.vue')['default'];
23
+ uColumnNotice: typeof import('../components/u-column-notice/u-column-notice.vue')['default'];
24
+ uCountDown: typeof import('../components/u-count-down/u-count-down.vue')['default'];
25
+ uCountTo: typeof import('../components/u-count-to/u-count-to.vue')['default'];
26
+ uDivider: typeof import('../components/u-divider/u-divider.vue')['default'];
27
+ uDropdown: typeof import('../components/u-dropdown/u-dropdown.vue')['default'];
28
+ uDropdownItem: typeof import('../components/u-dropdown-item/u-dropdown-item.vue')['default'];
29
+ uEmpty: typeof import('../components/u-empty/u-empty.vue')['default'];
30
+ uField: typeof import('../components/u-field/u-field.vue')['default'];
31
+ uForm: typeof import('../components/u-form/u-form.vue')['default'];
32
+ uFormItem: typeof import('../components/u-form-item/u-form-item.vue')['default'];
33
+ uFullScreen: typeof import('../components/u-full-screen/u-full-screen.vue')['default'];
34
+ uGap: typeof import('../components/u-gap/u-gap.vue')['default'];
35
+ uGrid: typeof import('../components/u-grid/u-grid.vue')['default'];
36
+ uGridItem: typeof import('../components/u-grid-item/u-grid-item.vue')['default'];
37
+ uIcon: typeof import('../components/u-icon/u-icon.vue')['default'];
38
+ uImage: typeof import('../components/u-image/u-image.vue')['default'];
39
+ uIndexAnchor: typeof import('../components/u-index-anchor/u-index-anchor.vue')['default'];
40
+ uIndexList: typeof import('../components/u-index-list/u-index-list.vue')['default'];
41
+ uInput: typeof import('../components/u-input/u-input.vue')['default'];
42
+ uKeyboard: typeof import('../components/u-keyboard/u-keyboard.vue')['default'];
43
+ uLazyLoad: typeof import('../components/u-lazy-load/u-lazy-load.vue')['default'];
44
+ uLine: typeof import('../components/u-line/u-line.vue')['default'];
45
+ uLineProgress: typeof import('../components/u-line-progress/u-line-progress.vue')['default'];
46
+ uLink: typeof import('../components/u-link/u-link.vue')['default'];
47
+ uLoadMore: typeof import('../components/u-loadmore/u-loadmore.vue')['default'];
48
+ uLoading: typeof import('../components/u-loading/u-loading.vue')['default'];
49
+ uMask: typeof import('../components/u-mask/u-mask.vue')['default'];
50
+ uMessageInput: typeof import('../components/u-message-input/u-message-input.vue')['default'];
51
+ uModal: typeof import('../components/u-modal/u-modal.vue')['default'];
52
+ uNavbar: typeof import('../components/u-navbar/u-navbar.vue')['default'];
53
+ uNoNetwork: typeof import('../components/u-no-network/u-no-network.vue')['default'];
54
+ uNoticeBar: typeof import('../components/u-notice-bar/u-notice-bar.vue')['default'];
55
+ uNumberBox: typeof import('../components/u-number-box/u-number-box.vue')['default'];
56
+ uNumberKeyboard: typeof import('../components/u-number-keyboard/u-number-keyboard.vue')['default'];
57
+ uPicker: typeof import('../components/u-picker/u-picker.vue')['default'];
58
+ uPopup: typeof import('../components/u-popup/u-popup.vue')['default'];
59
+ uRadio: typeof import('../components/u-radio/u-radio.vue')['default'];
60
+ uRadioGroup: typeof import('../components/u-radio-group/u-radio-group.vue')['default'];
61
+ uRate: typeof import('../components/u-rate/u-rate.vue')['default'];
62
+ uReadMore: typeof import('../components/u-read-more/u-read-more.vue')['default'];
63
+ uRow: typeof import('../components/u-row/u-row.vue')['default'];
64
+ uRowNotice: typeof import('../components/u-row-notice/u-row-notice.vue')['default'];
65
+ uSearch: typeof import('../components/u-search/u-search.vue')['default'];
66
+ uSection: typeof import('../components/u-section/u-section.vue')['default'];
67
+ uSelect: typeof import('../components/u-select/u-select.vue')['default'];
68
+ uSkeleton: typeof import('../components/u-skeleton/u-skeleton.vue')['default'];
69
+ uSlider: typeof import('../components/u-slider/u-slider.vue')['default'];
70
+ uSteps: typeof import('../components/u-steps/u-steps.vue')['default'];
71
+ uSticky: typeof import('../components/u-sticky/u-sticky.vue')['default'];
72
+ uSubsection: typeof import('../components/u-subsection/u-subsection.vue')['default'];
73
+ uSwipeAction: typeof import('../components/u-swipe-action/u-swipe-action.vue')['default'];
74
+ uSwiper: typeof import('../components/u-swiper/u-swiper.vue')['default'];
75
+ uSwitch: typeof import('../components/u-switch/u-switch.vue')['default'];
76
+ uTabbar: typeof import('../components/u-tabbar/u-tabbar.vue')['default'];
77
+ uTable: typeof import('../components/u-table/u-table.vue')['default'];
78
+ uTabs: typeof import('../components/u-tabs/u-tabs.vue')['default'];
79
+ uTabsSwiper: typeof import('../components/u-tabs-swiper/u-tabs-swiper.vue')['default'];
80
+ uTag: typeof import('../components/u-tag/u-tag.vue')['default'];
81
+ uTd: typeof import('../components/u-td/u-td.vue')['default'];
82
+ uTh: typeof import('../components/u-th/u-th.vue')['default'];
83
+ uTimeLine: typeof import('../components/u-time-line/u-time-line.vue')['default'];
84
+ uTimeLineItem: typeof import('../components/u-time-line-item/u-time-line-item.vue')['default'];
85
+ uToast: typeof import('../components/u-toast/u-toast.vue')['default'];
86
+ uTopTips: typeof import('../components/u-top-tips/u-top-tips.vue')['default'];
87
+ uTr: typeof import('../components/u-tr/u-tr.vue')['default'];
88
+ uUpload: typeof import('../components/u-upload/u-upload.vue')['default'];
89
+ uVerificationCode: typeof import('../components/u-verification-code/u-verification-code.vue')['default'];
90
+ uWaterfall: typeof import('../components/u-waterfall/u-waterfall.vue')['default'];
91
+ }
92
+ }
93
+
94
+ export {};
@@ -0,0 +1,30 @@
1
+ // 忽略 uview-pro 组件库内部的 TypeScript 错误
2
+ // 这些错误不影响组件的正常使用和类型提示
3
+
4
+ // 忽略 WeCropper 相关的类型错误
5
+ declare module 'weCropper' {
6
+ export class WeCropper {
7
+ constructor(params: any);
8
+ [key: string]: any;
9
+ }
10
+ }
11
+
12
+ // 忽略 base64 模块的类型错误
13
+ declare module 'base64' {
14
+ export function encode(data: any): string;
15
+ export function decode(data: string): any;
16
+ }
17
+
18
+ // 忽略其他内部模块的类型错误
19
+ declare module 'uview-pro/components/*' {
20
+ const component: any;
21
+ export default component;
22
+ }
23
+
24
+ // 忽略工具函数的类型错误
25
+ declare module 'uview-pro/libs/function/*' {
26
+ const func: any;
27
+ export default func;
28
+ }
29
+
30
+ export {};
@@ -0,0 +1,90 @@
1
+ /// <reference path="./components.d.ts" />
2
+ /// <reference path="./uni-app.d.ts" />
3
+
4
+ import http from '../libs/request/index';
5
+ import queryParams from '../libs/function/queryParams';
6
+ import route from '../libs/function/route';
7
+ import timeFormat from '../libs/function/timeFormat';
8
+ import timeFrom from '../libs/function/timeFrom';
9
+ import colorGradient from '../libs/function/colorGradient';
10
+ import guid from '../libs/function/guid';
11
+ import color from '../libs/function/color';
12
+ import type2icon from '../libs/function/type2icon';
13
+ import randomArray from '../libs/function/randomArray';
14
+ import deepClone from '../libs/function/deepClone';
15
+ import deepMerge from '../libs/function/deepMerge';
16
+ import addUnit from '../libs/function/addUnit';
17
+ import test from '../libs/function/test';
18
+ import random from '../libs/function/random';
19
+ import trim from '../libs/function/trim';
20
+ import toast from '../libs/function/toast';
21
+ import getParent from '../libs/function/getParent';
22
+ import $parent from '../libs/function/$parent';
23
+ import debounce from '../libs/function/debounce';
24
+ import throttle from '../libs/function/throttle';
25
+ import getRect from '../libs/function/getRect';
26
+ import { sys, os } from '../libs/function/sys';
27
+ import { parentData, parent } from '../libs/function/parent';
28
+ import config from '../libs/config/config';
29
+ import zIndex from '../libs/config/zIndex';
30
+ import { dispatch, broadcast } from '../libs/util/emitter';
31
+ import { mitt } from '../libs/util/mitt';
32
+
33
+ // uview-pro 模块类型声明
34
+ declare module 'uview-pro' {
35
+ // 导出安装函数
36
+ export function install(): void;
37
+
38
+ // 导出 $u 工具类型
39
+ export interface $Utils {
40
+ queryParams: typeof queryParams;
41
+ route: typeof route;
42
+ timeFormat: typeof timeFormat;
43
+ date: typeof timeFormat;
44
+ timeFrom: typeof timeFrom;
45
+ colorGradient: typeof colorGradient.colorGradient;
46
+ colorToRgba: typeof colorGradient.colorToRgba;
47
+ guid: typeof guid;
48
+ color: typeof color;
49
+ sys: typeof sys;
50
+ os: typeof os;
51
+ type2icon: typeof type2icon;
52
+ randomArray: typeof randomArray;
53
+ dispatch: typeof dispatch;
54
+ broadcast: typeof broadcast;
55
+ get: typeof http.get;
56
+ post: typeof http.post;
57
+ put: typeof http.put;
58
+ delete: typeof http.delete;
59
+ hexToRgb: typeof colorGradient.hexToRgb;
60
+ rgbToHex: typeof colorGradient.rgbToHex;
61
+ test: typeof test;
62
+ random: typeof random;
63
+ deepClone: typeof deepClone;
64
+ deepMerge: typeof deepMerge;
65
+ getParent: typeof getParent;
66
+ $parent: typeof $parent;
67
+ parent: typeof parent;
68
+ parentData: typeof parentData;
69
+ addUnit: typeof addUnit;
70
+ trim: typeof trim;
71
+ type: string[];
72
+ http: typeof http;
73
+ toast: typeof toast;
74
+ config: typeof config;
75
+ zIndex: typeof zIndex;
76
+ debounce: typeof debounce;
77
+ throttle: typeof throttle;
78
+ mitt: ReturnType<typeof mitt>;
79
+ getRect: typeof getRect;
80
+ }
81
+ }
82
+
83
+ // 全局类型扩展
84
+ declare global {
85
+ interface Uni {
86
+ $u: import('uview-pro').$Utils;
87
+ }
88
+ }
89
+
90
+ export {};
@@ -0,0 +1,63 @@
1
+ // /src/uni_modules/uview-pro/types/uni-app.d.ts
2
+ // 扩展全局 HTMLAttributes 以支持 uni-app/小程序自定义属性
3
+ import 'vue';
4
+
5
+ declare module 'vue' {
6
+ export interface GlobalComponents {
7
+ // UniApp core/native tags
8
+ view: any;
9
+ 'scroll-view': any;
10
+ swiper: any;
11
+ 'swiper-item': any;
12
+ image: any;
13
+ 'rich-text': any;
14
+ canvas: any;
15
+ block: any;
16
+
17
+ // Basic HTML shims often used by uni-app compiler
18
+ text: any;
19
+ }
20
+ interface HTMLAttributes {
21
+ // 支持小程序/uni-app 特有属性
22
+ 'hover-class'?: string;
23
+ 'hover-stop-propagation'?: boolean;
24
+ 'hover-start-time'?: number;
25
+ 'hover-stay-time'?: number;
26
+ animation?: string;
27
+ 'data-*'?: any;
28
+ catchtap?: (e: any) => void;
29
+ catchlongpress?: (e: any) => void;
30
+ catchtouchstart?: (e: any) => void;
31
+ catchtouchmove?: (e: any) => void;
32
+ catchtouchend?: (e: any) => void;
33
+ catchtouchcancel?: (e: any) => void;
34
+ // 其他常用 uni-app 事件和属性可按需补充
35
+ src?: string;
36
+ }
37
+ }
38
+
39
+ // 兼容 JSX/TSX 场景
40
+ declare global {
41
+ namespace JSX {
42
+ interface IntrinsicAttributes {
43
+ 'hover-class'?: string;
44
+ 'hover-stop-propagation'?: boolean;
45
+ 'hover-start-time'?: number;
46
+ 'hover-stay-time'?: number;
47
+ animation?: string;
48
+ 'data-*'?: any;
49
+ catchtap?: (e: any) => void;
50
+ catchlongpress?: (e: any) => void;
51
+ catchtouchstart?: (e: any) => void;
52
+ catchtouchmove?: (e: any) => void;
53
+ catchtouchend?: (e: any) => void;
54
+ catchtouchcancel?: (e: any) => void;
55
+ src?: string;
56
+ }
57
+ interface IntrinsicElements {
58
+ [elem: string]: any;
59
+ }
60
+ }
61
+ }
62
+
63
+ export {};