uview-plus 3.2.3 → 3.2.5

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.
Files changed (98) hide show
  1. package/changelog.md +7 -0
  2. package/components/u-checkbox/u-checkbox.vue +2 -2
  3. package/components/u-number-box/u-number-box.vue +4 -4
  4. package/components/u-picker/u-picker.vue +1 -1
  5. package/components/u-radio/u-radio.vue +2 -2
  6. package/components/u-rate/u-rate.vue +1 -1
  7. package/components/u-subsection/u-subsection.vue +22 -14
  8. package/components/u-switch/u-switch.vue +1 -1
  9. package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
  10. package/components/u-tag/u-tag.vue +1 -1
  11. package/index.js +5 -2
  12. package/libs/css/common.scss +3 -0
  13. package/libs/mixin/mpShare.js +15 -13
  14. package/package.json +1 -1
  15. package/types/comps/_common.d.ts +9 -0
  16. package/types/comps/actionSheet.d.ts +121 -0
  17. package/types/comps/album.d.ts +72 -0
  18. package/types/comps/alert.d.ts +55 -0
  19. package/types/comps/avatar.d.ts +85 -0
  20. package/types/comps/avatarGroup.d.ts +62 -0
  21. package/types/comps/backTop.d.ts +74 -0
  22. package/types/comps/badge.d.ts +76 -0
  23. package/types/comps/button.d.ts +169 -0
  24. package/types/comps/calendar.d.ts +164 -0
  25. package/types/comps/cell.d.ts +133 -0
  26. package/types/comps/cellGroup.d.ts +27 -0
  27. package/types/comps/checkbox.d.ts +69 -0
  28. package/types/comps/checkboxGroup.d.ts +93 -0
  29. package/types/comps/code.d.ts +69 -0
  30. package/types/comps/codeInput.d.ts +98 -0
  31. package/types/comps/col.d.ts +43 -0
  32. package/types/comps/collapse.d.ts +52 -0
  33. package/types/comps/collapseItem.d.ts +83 -0
  34. package/types/comps/countDown.d.ts +60 -0
  35. package/types/comps/countTo.d.ts +88 -0
  36. package/types/comps/datetimePicker.d.ts +146 -0
  37. package/types/comps/divider.d.ts +58 -0
  38. package/types/comps/empty.d.ts +72 -0
  39. package/types/comps/form.d.ts +76 -0
  40. package/types/comps/formItem.d.ts +68 -0
  41. package/types/comps/gap.d.ts +35 -0
  42. package/types/comps/grid.d.ts +34 -0
  43. package/types/comps/gridItem.d.ts +28 -0
  44. package/types/comps/icon.d.ts +93 -0
  45. package/types/comps/image.d.ts +119 -0
  46. package/types/comps/indexAnchor.d.ts +38 -0
  47. package/types/comps/indexItem.d.ts +18 -0
  48. package/types/comps/indexList.d.ts +39 -0
  49. package/types/comps/input.d.ts +234 -0
  50. package/types/comps/keyboard.d.ts +125 -0
  51. package/types/comps/line.d.ts +44 -0
  52. package/types/comps/lineProgress.d.ts +51 -0
  53. package/types/comps/link.d.ts +51 -0
  54. package/types/comps/list.d.ts +92 -0
  55. package/types/comps/listItem.d.ts +18 -0
  56. package/types/comps/loadMore.d.ts +108 -0
  57. package/types/comps/loadingIcon.d.ts +68 -0
  58. package/types/comps/loadingPage.d.ts +58 -0
  59. package/types/comps/modal.d.ts +115 -0
  60. package/types/comps/navbar.d.ts +113 -0
  61. package/types/comps/noNetwork.d.ts +40 -0
  62. package/types/comps/noticeBar.d.ts +85 -0
  63. package/types/comps/notify.d.ts +73 -0
  64. package/types/comps/numberBox.d.ts +155 -0
  65. package/types/comps/overlay.d.ts +46 -0
  66. package/types/comps/parse.d.ts +101 -0
  67. package/types/comps/picker.d.ts +115 -0
  68. package/types/comps/popup.d.ts +103 -0
  69. package/types/comps/radio.d.ts +77 -0
  70. package/types/comps/radioGroup.d.ts +97 -0
  71. package/types/comps/rate.d.ts +85 -0
  72. package/types/comps/readMore.d.ts +80 -0
  73. package/types/comps/row.d.ts +34 -0
  74. package/types/comps/scrollList.d.ts +51 -0
  75. package/types/comps/search.d.ts +167 -0
  76. package/types/comps/skeleton.d.ts +70 -0
  77. package/types/comps/slider.d.ts +79 -0
  78. package/types/comps/steps.d.ts +48 -0
  79. package/types/comps/stepsItem.d.ts +41 -0
  80. package/types/comps/sticky.d.ts +48 -0
  81. package/types/comps/subsection.d.ts +64 -0
  82. package/types/comps/swipeAction.d.ts +24 -0
  83. package/types/comps/swipeActionItem.d.ts +58 -0
  84. package/types/comps/swiper.d.ts +142 -0
  85. package/types/comps/swiperIndicator.d.ts +37 -0
  86. package/types/comps/switch.d.ts +73 -0
  87. package/types/comps/tabbar.d.ts +54 -0
  88. package/types/comps/tabbarItem.d.ts +52 -0
  89. package/types/comps/tabs.d.ts +85 -0
  90. package/types/comps/tag.d.ts +93 -0
  91. package/types/comps/text.d.ts +110 -0
  92. package/types/comps/textarea.d.ts +158 -0
  93. package/types/comps/toast.d.ts +59 -0
  94. package/types/comps/tooltip.d.ts +71 -0
  95. package/types/comps/transition.d.ts +61 -0
  96. package/types/comps/upload.d.ts +163 -0
  97. package/types/comps.d.ts +99 -0
  98. package/types/index.d.ts +47 -0
package/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 3.2.5(2024-04-13)
2
+ 调整分段器尺寸及修复窗口大小改变时重新计算尺寸
3
+
4
+ 多个组件支持cursor-pointer增强PC端体验
5
+
6
+ ## 3.2.4(2024-04-12)
7
+ 初步支持typescript
1
8
  ## 3.2.3(2024-04-12)
2
9
  fix: 修复square属性在小程序下无效问题
3
10
 
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <view
3
- class="u-checkbox"
3
+ class="u-checkbox cursor-pointer"
4
4
  :style="[checkboxStyle]"
5
5
  @tap.stop="wrapperClickHandler"
6
6
  :class="[`u-checkbox-label--${parentData.iconPlacement}`, parentData.borderBottom && parentData.placement === 'column' && 'u-border-bottom']"
7
7
  >
8
8
  <view
9
- class="u-checkbox__icon-wrap"
9
+ class="u-checkbox__icon-wrap cursor-pointer"
10
10
  @tap.stop="iconClickHandler"
11
11
  :class="iconClasses"
12
12
  :style="[iconWrapStyle]"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="u-number-box">
3
3
  <view
4
- class="u-number-box__slot"
4
+ class="u-number-box__slot cursor-pointer"
5
5
  @tap.stop="clickHandler('minus')"
6
6
  @touchstart="onTouchStart('minus')"
7
7
  @touchend.stop="clearTimeout"
@@ -11,7 +11,7 @@
11
11
  </view>
12
12
  <view
13
13
  v-else-if="showMinus"
14
- class="u-number-box__minus"
14
+ class="u-number-box__minus cursor-pointer"
15
15
  @tap.stop="clickHandler('minus')"
16
16
  @touchstart="onTouchStart('minus')"
17
17
  @touchend.stop="clearTimeout"
@@ -60,7 +60,7 @@
60
60
  <!-- #endif -->
61
61
  </slot>
62
62
  <view
63
- class="u-number-box__slot"
63
+ class="u-number-box__slot cursor-pointer"
64
64
  @tap.stop="clickHandler('plus')"
65
65
  @touchstart="onTouchStart('plus')"
66
66
  @touchend.stop="clearTimeout"
@@ -70,7 +70,7 @@
70
70
  </view>
71
71
  <view
72
72
  v-else-if="showPlus"
73
- class="u-number-box__plus"
73
+ class="u-number-box__plus cursor-pointer"
74
74
  @tap.stop="clickHandler('plus')"
75
75
  @touchstart="onTouchStart('plus')"
76
76
  @touchend.stop="clearTimeout"
@@ -80,7 +80,7 @@
80
80
  */
81
81
  import props from './props.js';
82
82
  import mpMixin from '../../libs/mixin/mpMixin.js';
83
- import mixin from '../../libs/mixin/mixin.js';
83
+ import mixin from '../../libs/mixin/mixin.js';
84
84
  export default {
85
85
  name: 'u-picker',
86
86
  mixins: [mpMixin, mixin, props],
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <view
3
- class="u-radio"
3
+ class="u-radio cursor-pointer"
4
4
  @tap.stop="wrapperClickHandler"
5
5
  :style="[radioStyle]"
6
6
  :class="[`u-radio-label--${parentData.iconPlacement}`, parentData.borderBottom && parentData.placement === 'column' && 'u-border-bottom']"
7
7
  >
8
8
  <view
9
- class="u-radio__icon-wrap"
9
+ class="u-radio__icon-wrap cursor-pointer"
10
10
  @tap.stop="iconClickHandler"
11
11
  :class="iconClasses"
12
12
  :style="[iconWrapStyle]"
@@ -11,7 +11,7 @@
11
11
  @touchend.stop="touchEnd"
12
12
  >
13
13
  <view
14
- class="u-rate__content__item"
14
+ class="u-rate__content__item cursor-pointer"
15
15
  v-for="(item, index) in Number(count)"
16
16
  :key="index"
17
17
  :class="[elClass]"
@@ -83,7 +83,8 @@ export default {
83
83
  width: 0,
84
84
  height: 0,
85
85
  },
86
- innerCurrent: ''
86
+ innerCurrent: '',
87
+ windowResizeCallback: {}
87
88
  };
88
89
  },
89
90
  watch: {
@@ -179,6 +180,13 @@ export default {
179
180
  },
180
181
  mounted() {
181
182
  this.init();
183
+ this.windowResizeCallback = (res) => {
184
+ this.init();
185
+ }
186
+ uni.onWindowResize(this.windowResizeCallback)
187
+ },
188
+ beforeUnmount() {
189
+ uni.offWindowResize(this.windowResizeCallback)
182
190
  },
183
191
  emits: ["change"],
184
192
  methods: {
@@ -227,20 +235,20 @@ export default {
227
235
  /* #endif */
228
236
 
229
237
  &--button {
230
- height: 32px;
238
+ height: 34px;
231
239
  background-color: rgb(238, 238, 239);
232
240
  padding: 3px;
233
- border-radius: 3px;
241
+ border-radius: 4px;
234
242
  align-items: stretch;
235
243
 
236
244
  &__bar {
237
245
  background-color: #ffffff;
238
- border-radius: 3px !important;
246
+ border-radius: 4px !important;
239
247
  }
240
248
  }
241
249
 
242
250
  &--subsection {
243
- height: 30px;
251
+ height: 32px;
244
252
  }
245
253
 
246
254
  &__bar {
@@ -252,8 +260,8 @@ export default {
252
260
  /* #endif */
253
261
 
254
262
  &--first {
255
- border-top-left-radius: 3px;
256
- border-bottom-left-radius: 3px;
263
+ border-top-left-radius: 4px;
264
+ border-bottom-left-radius: 4px;
257
265
  border-top-right-radius: 0px;
258
266
  border-bottom-right-radius: 0px;
259
267
  }
@@ -268,8 +276,8 @@ export default {
268
276
  &--last {
269
277
  border-top-left-radius: 0px;
270
278
  border-bottom-left-radius: 0px;
271
- border-top-right-radius: 3px;
272
- border-bottom-right-radius: 3px;
279
+ border-top-right-radius: 4px;
280
+ border-bottom-right-radius: 4px;
273
281
  }
274
282
  }
275
283
 
@@ -286,18 +294,18 @@ export default {
286
294
  }
287
295
 
288
296
  &--first {
289
- border-top-left-radius: 3px;
290
- border-bottom-left-radius: 3px;
297
+ border-top-left-radius: 4px;
298
+ border-bottom-left-radius: 4px;
291
299
  }
292
300
 
293
301
  &--last {
294
- border-top-right-radius: 3px;
295
- border-bottom-right-radius: 3px;
302
+ border-top-right-radius: 4px;
303
+ border-bottom-right-radius: 4px;
296
304
  }
297
305
 
298
306
  &__text {
299
307
  font-size: 12px;
300
- line-height: 12px;
308
+ line-height: 14px;
301
309
  @include flex;
302
310
  align-items: center;
303
311
  transition-property: color;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- class="u-switch"
3
+ class="u-switch cursor-pointer"
4
4
  :class="[disabled && 'u-switch--disabled']"
5
5
  :style="[switchStyle, $u.addStyle(customStyle)]"
6
6
  @tap="clickHandler"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- class="u-tabbar-item"
3
+ class="u-tabbar-item cursor-pointer"
4
4
  :style="[$u.addStyle(customStyle)]"
5
5
  @tap="clickHandler"
6
6
  >
@@ -4,7 +4,7 @@
4
4
  :show="show"
5
5
  style="display: inline-flex;"
6
6
  >
7
- <view class="u-tag-wrapper">
7
+ <view class="u-tag-wrapper cursor-pointer">
8
8
  <view
9
9
  class="u-tag"
10
10
  :class="[`u-tag--${shape}`, !plain && `u-tag--${type}`, plain && `u-tag--${type}--plain`, `u-tag--${size}`, plain && plainFill && `u-tag--${type}--plain--fill`]"
package/index.js CHANGED
@@ -34,8 +34,11 @@ import color from './libs/config/color.js'
34
34
  import platform from './libs/function/platform'
35
35
 
36
36
  // 导出
37
+ const http = new Request()
38
+ let themeType = ['primary', 'success', 'error', 'warning', 'info'];
39
+ export { route, http, debounce, throttle, platform, themeType, mixin, mpMixin, props, color, test, zIndex }
37
40
  export * from './libs/function/index.js'
38
- export const http = new Request()
41
+ export * from './libs/function/colorGradient.js'
39
42
 
40
43
  const $u = {
41
44
  route,
@@ -45,7 +48,7 @@ const $u = {
45
48
  rgbToHex: colorGradient.rgbToHex,
46
49
  colorToRgba: colorGradient.colorToRgba,
47
50
  test,
48
- type: ['primary', 'success', 'error', 'warning', 'info'],
51
+ type: themeType,
49
52
  http,
50
53
  config, // uview-plus配置信息相关,比如版本号
51
54
  zIndex,
@@ -95,3 +95,6 @@
95
95
  opacity: 0.7;
96
96
  }
97
97
 
98
+ .cursor-pointer {
99
+ cursor: pointer;
100
+ }
@@ -1,13 +1,15 @@
1
- export default {
2
- onLoad() {
3
- // 设置默认的转发参数
4
- uni.$u.mpShare = {
5
- title: '', // 默认为小程序名称
6
- path: '', // 默认为当前页面路径
7
- imageUrl: '' // 默认为当前页面的截图
8
- }
9
- },
10
- onShareAppMessage() {
11
- return uni.$u.mpShare
12
- }
13
- }
1
+
2
+ export default {
3
+ data() {
4
+ return {
5
+ mpShare: {
6
+ title: '', // 默认为小程序名称
7
+ path: '', // 默认为当前页面路径
8
+ imageUrl: '' // 默认为当前页面的截图
9
+ }
10
+ }
11
+ },
12
+ onShareAppMessage() {
13
+ return this.mpShare;
14
+ }
15
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
- "version": "3.2.3",
5
+ "version": "3.2.5",
6
6
  "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
@@ -0,0 +1,9 @@
1
+ export interface AllowedComponentProps {
2
+ class?: unknown;
3
+ style?: unknown;
4
+ }
5
+
6
+ export interface VNodeProps {
7
+ key?: string | number | symbol;
8
+ ref?: unknown;
9
+ }
@@ -0,0 +1,121 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface ActionSheetProps {
4
+ /**
5
+ * 是否展示
6
+ * @default false
7
+ */
8
+ show?: boolean
9
+ /**
10
+ * 设置标题
11
+ */
12
+ title?: string
13
+ /**
14
+ * 选项上方的描述信息
15
+ */
16
+ description?: string
17
+ /**
18
+ * 按钮的文字数组
19
+ * @default []
20
+ */
21
+ actions?: any[]
22
+ /**
23
+ * 取消按钮的文字,不为空时显示按钮
24
+ */
25
+ cancelText?: string
26
+ /**
27
+ * 点击某个菜单项时是否关闭弹窗
28
+ */
29
+ closeOnClickAction?: string
30
+ /**
31
+ * 是否开启底部安全区适配
32
+ * @default false
33
+ */
34
+ safeAreaInsetBottom?: boolean
35
+ /**
36
+ * 小程序的打开方式
37
+ */
38
+ openType?: string
39
+ /**
40
+ * 点击遮罩是否允许关闭
41
+ */
42
+ closeOnClickOverlay?: boolean
43
+ /**
44
+ * 圆角值,默认无圆角
45
+ * @default 0
46
+ */
47
+ round?: string | number
48
+ /**
49
+ * 指定返回用户信息的语言
50
+ * @default "en"
51
+ */
52
+ lang?: 'zh_CN' | 'zh_TW' | 'en'
53
+ /**
54
+ * 会话来源,open-type="contact"时有效。只微信小程序有效
55
+ */
56
+ sessionFrom?: string
57
+ /**
58
+ * 会话内消息卡片标题,openType="contact"时有效
59
+ */
60
+ sendMessageTitle?: string
61
+ /**
62
+ * 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
63
+ */
64
+ sendMessagePath?: string
65
+ /**
66
+ * 会话内消息卡片图片,openType="contact"时有效
67
+ */
68
+ sendMessageImg?: string
69
+ /**
70
+ * 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效
71
+ * @default false
72
+ */
73
+ showMessageCard?: boolean
74
+ /**
75
+ * 打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效
76
+ */
77
+ appParameter?: string
78
+ /**
79
+ * 点击ActionSheet列表项时触发
80
+ */
81
+ onSelect?: () => any
82
+ /**
83
+ * 点击取消按钮时触发
84
+ */
85
+ onClose?: () => any
86
+ /**
87
+ * 获取用户信息回调,openType="getUserInfo"时有效
88
+ * @param detail 用户信息
89
+ */
90
+ onGetuserinfo?: (detail: any) => any
91
+ /**
92
+ * 客服消息回调,openType="contact"时有效
93
+ */
94
+ onContact?: () => any
95
+ /**
96
+ * 获取用户手机号回调,openType="getPhoneNumber"时有效
97
+ */
98
+ onGetphonenumber?: () => any
99
+ /**
100
+ * 当使用开放能力时,发生错误的回调
101
+ */
102
+ onError?: (...args: any) => any
103
+ /**
104
+ * 在打开授权设置页并关闭后回调
105
+ */
106
+ onOpensetting?: (...args: any) => any
107
+ /**
108
+ * 打开 APP 成功的回调
109
+ */
110
+ onLaunchapp?: (...args: any) => any
111
+ }
112
+
113
+ declare interface _ActionSheet {
114
+ new (): {
115
+ $props: AllowedComponentProps &
116
+ VNodeProps &
117
+ ActionSheetProps
118
+ }
119
+ }
120
+
121
+ export declare const ActionSheet: _ActionSheet
@@ -0,0 +1,72 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface AlbumProps {
4
+ /**
5
+ * 图片地址列表
6
+ */
7
+ urls?: string[] | Record<string, any>[]
8
+ /**
9
+ * 指定从数组的对象元素中读取哪个属性作为图片地址
10
+ */
11
+ keyName?: string
12
+ /**
13
+ * 单图时,图片长边的长度
14
+ * @default 180
15
+ */
16
+ singleSize?: string | number
17
+ /**
18
+ * 多图时,图片边长
19
+ * @default 70
20
+ */
21
+ multipleSize?: string | number
22
+ /**
23
+ * 多图时,图片水平和垂直之间的间隔
24
+ * @default 6
25
+ */
26
+ space?: string | number
27
+ /**
28
+ * 单图时,图片缩放裁剪的模式
29
+ * @default "scaleToFill"
30
+ */
31
+ singleMode?: ImageMode
32
+ /**
33
+ * 多图时,图片缩放裁剪的模式
34
+ * @default "aspectFill"
35
+ */
36
+ multipleMode?: ImageMode
37
+ /**
38
+ * 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量
39
+ * @default 9
40
+ */
41
+ maxCount?: string | number
42
+ /**
43
+ * 是否可以预览图片
44
+ * @default true
45
+ */
46
+ previewFullImage?: boolean
47
+ /**
48
+ * 每行展示图片数量,如设置,singleSize和multipleSize将会无效
49
+ * @default 3
50
+ */
51
+ rowCount?: string | number
52
+ /**
53
+ * 超出maxCount时是否显示查看更多的提示
54
+ * @default true
55
+ */
56
+ showMore?: boolean
57
+ /**
58
+ * 某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送
59
+ * @param width 宽度
60
+ */
61
+ onAlbumWidth?: (width: any) => any
62
+ }
63
+
64
+ declare interface _Album {
65
+ new (): {
66
+ $props: AllowedComponentProps &
67
+ VNodeProps &
68
+ AlbumProps
69
+ }
70
+ }
71
+
72
+ export declare const Album: _Album
@@ -0,0 +1,55 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface AlertProps {
4
+ /**
5
+ * 显示的文字
6
+ */
7
+ title?: string
8
+ /**
9
+ * 使用预设的颜色
10
+ * @default "warning"
11
+ */
12
+ type?: 'warning' | 'success' | 'primary' | 'error' | 'info'
13
+ /**
14
+ * 辅助性文字,颜色比`title`浅一点,字号也小一点,可选
15
+ */
16
+ description?: string
17
+ /**
18
+ * 关闭按钮(默认为叉号icon图标)
19
+ * @default false
20
+ */
21
+ closable?: boolean
22
+ /**
23
+ * 是否显示左边的辅助图标
24
+ * @default false
25
+ */
26
+ showIcon?: boolean
27
+ /**
28
+ * 多图时,图片缩放裁剪的模式
29
+ */
30
+ effect?: 'light' | 'dark'
31
+ /**
32
+ * 文字是否居中
33
+ * @default false
34
+ */
35
+ center?: boolean
36
+ /**
37
+ * 字体大小
38
+ * @default 14
39
+ */
40
+ fontSize?: string | number
41
+ /**
42
+ * 点击组件时触发
43
+ */
44
+ onClick?: () => any
45
+ }
46
+
47
+ declare interface _Alert {
48
+ new (): {
49
+ $props: AllowedComponentProps &
50
+ VNodeProps &
51
+ AlertProps
52
+ }
53
+ }
54
+
55
+ export declare const Alert: _Alert
@@ -0,0 +1,85 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+ import { ImageMode } from './image'
3
+
4
+ declare interface AvatarProps {
5
+ /**
6
+ * 头像路径,如加载失败,将会显示默认头像(不能为相对路径)
7
+ */
8
+ src?: string
9
+ /**
10
+ * 头像形状
11
+ * @default "circle"
12
+ */
13
+ shape?: 'circle' | 'square'
14
+ /**
15
+ * 头像尺寸
16
+ * @default 40
17
+ */
18
+ size?: 'large' | 'default' | 'mini' | number
19
+ /**
20
+ * 裁剪类型
21
+ * @default "scaleToFill"
22
+ */
23
+ mode?: ImageMode
24
+ /**
25
+ * 用文字替代图片,级别优先于`src`
26
+ */
27
+ text?: string
28
+ /**
29
+ * 背景颜色
30
+ * @default "#c0c4cc"
31
+ */
32
+ bgColor?: string
33
+ /**
34
+ * 文字颜色
35
+ * @default "#fff"
36
+ */
37
+ color?: string
38
+ /**
39
+ * 文字大小
40
+ * @default 18
41
+ */
42
+ fontSize?: string | number
43
+ /**
44
+ * 显示的图标
45
+ */
46
+ icon?: string
47
+ /**
48
+ * 显示小程序头像,只对百度,微信,QQ小程序有效
49
+ * @default false
50
+ */
51
+ mpAvatar?: boolean
52
+ /**
53
+ * 是否使用随机背景色
54
+ * @default false
55
+ */
56
+ randomBgColor?: boolean
57
+ /**
58
+ * 加载失败的默认头像(组件有内置默认图片)
59
+ */
60
+ defaultUrl?: string
61
+ /**
62
+ * 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间
63
+ */
64
+ colorIndex?: string | number
65
+ /**
66
+ * 组件标识符
67
+ * @default "level"
68
+ */
69
+ name?: string
70
+ /**
71
+ * 头像被点击
72
+ * @param index 用户传递的标识符
73
+ */
74
+ onClick?: (index: any) => any
75
+ }
76
+
77
+ declare interface _Avatar {
78
+ new (): {
79
+ $props: AllowedComponentProps &
80
+ VNodeProps &
81
+ AvatarProps
82
+ }
83
+ }
84
+
85
+ export declare const Avatar: _Avatar