uview-pro 0.0.3 → 0.0.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 (76) hide show
  1. package/changelog.md +156 -1
  2. package/components/u-action-sheet/u-action-sheet.vue +4 -4
  3. package/components/u-avatar/u-avatar.vue +1 -1
  4. package/components/u-badge/u-badge.vue +1 -1
  5. package/components/u-button/u-button.vue +102 -25
  6. package/components/u-card/u-card.vue +1 -1
  7. package/components/u-cell-group/u-cell-group.vue +1 -1
  8. package/components/u-cell-item/u-cell-item.vue +1 -1
  9. package/components/u-checkbox/u-checkbox.vue +1 -1
  10. package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
  11. package/components/u-circle-progress/u-circle-progress.vue +1 -1
  12. package/components/u-city-select/u-city-select.vue +244 -0
  13. package/components/u-col/u-col.vue +1 -1
  14. package/components/u-collapse/u-collapse.vue +1 -1
  15. package/components/u-collapse-item/u-collapse-item.vue +2 -2
  16. package/components/u-count-down/u-count-down.vue +1 -1
  17. package/components/u-count-to/u-count-to.vue +1 -1
  18. package/components/u-divider/u-divider.vue +1 -1
  19. package/components/u-empty/u-empty.vue +1 -1
  20. package/components/u-field/u-field.vue +1 -1
  21. package/components/u-gap/u-gap.vue +1 -1
  22. package/components/u-grid/u-grid.vue +1 -1
  23. package/components/u-grid-item/u-grid-item.vue +1 -1
  24. package/components/u-icon/u-icon.vue +29 -23
  25. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  26. package/components/u-index-list/u-index-list.vue +1 -1
  27. package/components/u-keyboard/u-keyboard.vue +1 -1
  28. package/components/u-lazy-load/u-lazy-load.vue +1 -1
  29. package/components/u-line/u-line.vue +1 -1
  30. package/components/u-line-progress/u-line-progress.vue +1 -1
  31. package/components/u-link/u-link.vue +1 -1
  32. package/components/u-loading/u-loading.vue +1 -1
  33. package/components/u-loadmore/u-loadmore.vue +1 -1
  34. package/components/u-mask/u-mask.vue +1 -1
  35. package/components/u-message-input/u-message-input.vue +1 -1
  36. package/components/u-modal/u-modal.vue +1 -1
  37. package/components/u-navbar/u-navbar.vue +1 -1
  38. package/components/u-no-network/u-no-network.vue +1 -1
  39. package/components/u-notice-bar/u-notice-bar.vue +1 -1
  40. package/components/u-number-box/u-number-box.vue +1 -1
  41. package/components/u-picker/u-picker.vue +1 -1
  42. package/components/u-popup/u-popup.vue +1 -1
  43. package/components/u-radio/u-radio.vue +1 -1
  44. package/components/u-radio-group/u-radio-group.vue +1 -1
  45. package/components/u-rate/u-rate.vue +1 -1
  46. package/components/u-read-more/u-read-more.vue +1 -1
  47. package/components/u-row/u-row.vue +1 -1
  48. package/components/u-search/u-search.vue +1 -1
  49. package/components/u-section/u-section.vue +1 -1
  50. package/components/u-skeleton/u-skeleton.vue +1 -1
  51. package/components/u-steps/u-steps.vue +1 -1
  52. package/components/u-sticky/u-sticky.vue +1 -1
  53. package/components/u-subsection/u-subsection.vue +1 -1
  54. package/components/u-swipe-action/u-swipe-action.vue +1 -1
  55. package/components/u-swiper/u-swiper.vue +1 -1
  56. package/components/u-switch/u-switch.vue +1 -1
  57. package/components/u-table/u-table.vue +1 -1
  58. package/components/u-tabs/u-tabs.vue +1 -1
  59. package/components/u-tabs-swiper/u-tabs-swiper.vue +1 -1
  60. package/components/u-tag/u-tag.vue +1 -1
  61. package/components/u-td/u-td.vue +1 -1
  62. package/components/u-th/u-th.vue +1 -1
  63. package/components/u-time-line/u-time-line.vue +1 -1
  64. package/components/u-time-line-item/u-time-line-item.vue +1 -1
  65. package/components/u-toast/u-toast.vue +1 -1
  66. package/components/u-top-tips/u-top-tips.vue +1 -1
  67. package/components/u-tr/u-tr.vue +1 -1
  68. package/components/u-upload/u-upload.vue +12 -6
  69. package/components/u-verification-code/u-verification-code.vue +1 -1
  70. package/components/u-waterfall/u-waterfall.vue +1 -1
  71. package/libs/function/md5.ts +3 -1
  72. package/libs/request/auto-http.ts +76 -0
  73. package/libs/request/uni-http.md +156 -0
  74. package/libs/request/uni-http.ts +434 -0
  75. package/package.json +5 -3
  76. package/readme.md +33 -15
@@ -0,0 +1,244 @@
1
+ <template>
2
+ <u-popup
3
+ v-model="popupValue"
4
+ mode="bottom"
5
+ :popup="false"
6
+ :mask="true"
7
+ :closeable="true"
8
+ :safe-area-inset-bottom="true"
9
+ close-icon-color="#ffffff"
10
+ :z-index="uZIndex"
11
+ :maskCloseAble="props.maskCloseAble"
12
+ @close="close"
13
+ >
14
+ <u-tabs v-if="popupValue" :list="genTabsList" :is-scroll="true" :current="tabsIndex" @change="tabsChange" ref="tabs"></u-tabs>
15
+ <view class="area-box">
16
+ <view class="u-flex" :class="{ change: isChange }">
17
+ <!-- 省 -->
18
+ <view class="area-item">
19
+ <view class="u-padding-10 u-bg-gray" style="height: 100%">
20
+ <scroll-view :scroll-y="true" style="height: 100%">
21
+ <u-cell-group>
22
+ <u-cell-item v-for="(item, index) in provincesList" :title="item.label" :arrow="false" :index="index" :key="index" @click="provinceChange(index)">
23
+ <template v-if="isChooseP && province === index" #right-icon>
24
+ <u-icon size="34" name="checkbox-mark"></u-icon>
25
+ </template>
26
+ </u-cell-item>
27
+ </u-cell-group>
28
+ </scroll-view>
29
+ </view>
30
+ </view>
31
+ <!-- 市 -->
32
+ <view class="area-item">
33
+ <view class="u-padding-10 u-bg-gray" style="height: 100%">
34
+ <scroll-view :scroll-y="true" style="height: 100%">
35
+ <u-cell-group v-if="isChooseP">
36
+ <u-cell-item v-for="(item, index) in citys" :title="item.label" :arrow="false" :index="index" :key="index" @click="cityChange(index)">
37
+ <template v-if="isChooseC && city === index" #right-icon>
38
+ <u-icon size="34" name="checkbox-mark"></u-icon>
39
+ </template>
40
+ </u-cell-item>
41
+ </u-cell-group>
42
+ </scroll-view>
43
+ </view>
44
+ </view>
45
+ <!-- 区 -->
46
+ <view class="area-item">
47
+ <view class="u-padding-10 u-bg-gray" style="height: 100%">
48
+ <scroll-view :scroll-y="true" style="height: 100%">
49
+ <u-cell-group v-if="isChooseC">
50
+ <u-cell-item v-for="(item, index) in areas" :title="item.label" :arrow="false" :index="index" :key="index" @click="areaChange(index)">
51
+ <template v-if="isChooseA && area === index" #right-icon>
52
+ <u-icon size="34" name="checkbox-mark"></u-icon>
53
+ </template>
54
+ </u-cell-item>
55
+ </u-cell-group>
56
+ </scroll-view>
57
+ </view>
58
+ </view>
59
+ </view>
60
+ </view>
61
+ </u-popup>
62
+ </template>
63
+
64
+ <script setup lang="ts">
65
+ import { ref, computed, onMounted } from 'vue';
66
+ import provinces from '../../libs/util/province';
67
+ import citysData from '../../libs/util/city';
68
+ import areasData from '../../libs/util/area';
69
+ import type { PropType } from 'vue';
70
+
71
+ defineOptions({
72
+ name: 'u-city-select'
73
+ });
74
+
75
+ /**
76
+ * u-city-select 城市选择器
77
+ * @description 用于选择省、市、区三级行政区域,支持回显和自定义初始值。
78
+ * @property {Boolean} modelValue 控制弹窗显示与隐藏(v-model)
79
+ * @property {Array} defaultRegion 默认选中的省市区名称数组,如 ['广东省', '广州市', '天河区']
80
+ * @property {Array} areaCode 默认选中的省市区编码数组,如 ['440000', '440100', '440106']
81
+ * @property {Boolean} maskCloseAble 是否允许点击遮罩关闭弹窗(默认 true)
82
+ * @property {String|Number} zIndex 弹窗层级(默认 0,自动适配)
83
+ * @event update:modelValue v-model 绑定值变化时触发
84
+ * @event city-change 选择省市区后触发,返回选中的省市区对象
85
+ * @example <u-city-select v-model="show" :defaultRegion="['广东省','广州市','天河区']" @city-change="onChange"></u-city-select>
86
+ */
87
+
88
+ // props 定义
89
+ const props = defineProps({
90
+ modelValue: { type: Boolean, default: false },
91
+ defaultRegion: { type: Array as PropType<string[]>, default: () => [] },
92
+ areaCode: { type: Array as PropType<string[]>, default: () => [] },
93
+ maskCloseAble: { type: Boolean, default: true },
94
+ zIndex: { type: [String, Number], default: 0 }
95
+ });
96
+
97
+ // emits 定义
98
+ const emit = defineEmits(['update:modelValue', 'city-change']);
99
+
100
+ // 省市区选择相关响应式数据
101
+ const cityValue = ref('');
102
+ const isChooseP = ref(false); // 是否已选省
103
+ const province = ref(0); // 省下标
104
+ const provincesList = ref(provinces);
105
+ const isChooseC = ref(false); // 是否已选市
106
+ const city = ref(0); // 市下标
107
+ const citys = ref(citysData[0]);
108
+ const isChooseA = ref(false); // 是否已选区
109
+ const area = ref(0); // 区下标
110
+ const areas = ref(areasData[0][0]);
111
+ const tabsIndex = ref(0);
112
+
113
+ // v-model 双向绑定
114
+ const popupValue = computed({
115
+ get: () => props.modelValue,
116
+ set: val => emit('update:modelValue', val)
117
+ });
118
+
119
+ // 是否切换到区级
120
+ const isChange = computed(() => tabsIndex.value > 1);
121
+
122
+ // 顶部 tab 列表
123
+ const genTabsList = computed(() => {
124
+ const tabsList = [{ name: '请选择' }];
125
+ if (isChooseP.value) {
126
+ tabsList[0].name = provincesList.value[province.value].label;
127
+ tabsList[1] = { name: '请选择' };
128
+ }
129
+ if (isChooseC.value) {
130
+ tabsList[1].name = citys.value[city.value].label;
131
+ tabsList[2] = { name: '请选择' };
132
+ }
133
+ if (isChooseA.value) {
134
+ tabsList[2].name = areas.value[area.value].label;
135
+ }
136
+ return tabsList;
137
+ });
138
+
139
+ // z-index 计算
140
+ const uZIndex = computed(() => (props.zIndex ? props.zIndex : (uni as any).$u?.zIndex?.popup || 1075));
141
+
142
+ // 初始化选中项
143
+ function init() {
144
+ if (props.areaCode.length === 3) {
145
+ setProvince('', props.areaCode[0]);
146
+ setCity('', props.areaCode[1]);
147
+ setArea('', props.areaCode[2]);
148
+ } else if (props.defaultRegion.length === 3) {
149
+ setProvince(props.defaultRegion[0], '');
150
+ setCity(props.defaultRegion[1], '');
151
+ setArea(props.defaultRegion[2], '');
152
+ }
153
+ }
154
+
155
+ // 选中省
156
+ function setProvince(label = '', value = '') {
157
+ provincesList.value.forEach((v, k) => {
158
+ if (value ? v.value == value : v.label == label) {
159
+ provinceChange(k);
160
+ }
161
+ });
162
+ }
163
+ // 选中市
164
+ function setCity(label = '', value = '') {
165
+ citys.value.forEach((v, k) => {
166
+ if (value ? v.value == value : v.label == label) {
167
+ cityChange(k);
168
+ }
169
+ });
170
+ }
171
+ // 选中区
172
+ function setArea(label = '', value = '') {
173
+ areas.value.forEach((v, k) => {
174
+ if (value ? v.value == value : v.label == label) {
175
+ isChooseA.value = true;
176
+ area.value = k;
177
+ }
178
+ });
179
+ }
180
+
181
+ // 关闭弹窗
182
+ function close() {
183
+ emit('update:modelValue', false);
184
+ }
185
+ // tab 切换
186
+ function tabsChange(index: number) {
187
+ tabsIndex.value = index;
188
+ }
189
+ // 省点击
190
+ function provinceChange(index: number) {
191
+ isChooseP.value = true;
192
+ isChooseC.value = false;
193
+ isChooseA.value = false;
194
+ province.value = index;
195
+ citys.value = citysData[index];
196
+ tabsIndex.value = 1;
197
+ }
198
+ // 市点击
199
+ function cityChange(index: number) {
200
+ isChooseC.value = true;
201
+ isChooseA.value = false;
202
+ city.value = index;
203
+ areas.value = areasData[province.value][index];
204
+ tabsIndex.value = 2;
205
+ }
206
+ // 区点击
207
+ function areaChange(index: number) {
208
+ isChooseA.value = true;
209
+ area.value = index;
210
+ const result = {
211
+ province: provincesList.value[province.value],
212
+ city: citys.value[city.value],
213
+ area: areas.value[area.value]
214
+ };
215
+ emit('city-change', result);
216
+ close();
217
+ }
218
+
219
+ // 挂载时初始化
220
+ onMounted(init);
221
+ </script>
222
+
223
+ <style lang="scss">
224
+ .area-box {
225
+ width: 100%;
226
+ overflow: hidden;
227
+ height: 800rpx;
228
+
229
+ > view {
230
+ width: 150%;
231
+ transition: transform 0.3s ease-in-out 0s;
232
+ transform: translateX(0);
233
+
234
+ &.change {
235
+ transform: translateX(-33.3333333%);
236
+ }
237
+ }
238
+
239
+ .area-item {
240
+ width: 33.3333333%;
241
+ height: 800rpx;
242
+ }
243
+ }
244
+ </style>
@@ -14,7 +14,7 @@ defineOptions({
14
14
  /**
15
15
  * col 布局单元格
16
16
  * @description 通过基础的 12 分栏,迅速简便地创建布局(搭配<u-row>使用)
17
- * @tutorial https://uview-pro.anyup.cn/docs/components/layout.html
17
+ * @tutorial https://uview-pro.netlify.app/components/layout.html
18
18
  * @property {String|Number} span 栅格占据的列数,总12等分(默认0)
19
19
  * @property {String} text-align 文字水平对齐方式(默认left)
20
20
  * @property {String|Number} offset 分栏左边偏移,计算方式与span相同(默认0)
@@ -14,7 +14,7 @@ defineOptions({
14
14
  /**
15
15
  * collapse 手风琴
16
16
  * @description 通过折叠面板收纳内容区域
17
- * @tutorial https://uview-pro.anyup.cn/docs/components/collapse.html
17
+ * @tutorial https://uview-pro.netlify.app/components/collapse.html
18
18
  * @property {Boolean} accordion 是否手风琴模式(默认true)
19
19
  * @property {Boolean} arrow 是否显示标题右侧的箭头(默认true)
20
20
  * @property {String} arrow-color 标题右侧箭头的颜色(默认#909399)
@@ -31,7 +31,7 @@ defineOptions({
31
31
  /**
32
32
  * collapseItem 手风琴Item
33
33
  * @description 通过折叠面板收纳内容区域(搭配u-collapse使用)
34
- * @tutorial https://uview-pro.anyup.cn/docs/components/collapse.html
34
+ * @tutorial https://uview-pro.netlify.app/components/collapse.html
35
35
  * @property {String} title 面板标题
36
36
  * @property {String Number} index 主要用于事件的回调,标识那个Item被点击
37
37
  * @property {Boolean} disabled 面板是否可以打开或收起(默认false)
@@ -121,7 +121,7 @@ function headClick() {
121
121
  * 查询内容高度
122
122
  */
123
123
  function queryRect() {
124
- // getRect为uView自带的节点查询简化方法,详见文档介绍:https://uview-pro.anyup.cn/docs/js/getRect.html
124
+ // getRect为uView自带的节点查询简化方法,详见文档介绍:https://uview-pro.netlify.app/js/getRect.html
125
125
  // 组件内部一般用this.$uGetRect,对外的为this.$u.getRect,二者功能一致,名称不同
126
126
  $u.getRect('#' + elId.value, instance).then((res: any) => {
127
127
  height.value = res.height;
@@ -59,7 +59,7 @@ defineOptions({ name: 'u-count-down' });
59
59
  /**
60
60
  * countDown 倒计时
61
61
  * @description 该组件一般使用于某个活动的截止时间上,通过数字的变化,给用户明确的时间感受,提示用户进行某一个行为操作。
62
- * @tutorial https://uview-pro.anyup.cn/docs/components/countDown.html
62
+ * @tutorial https://uview-pro.netlify.app/components/countDown.html
63
63
  * @property {String | Number} timestamp 倒计时,单位为秒
64
64
  * @property {Boolean} autoplay 是否自动开始倒计时,如果为false,需手动调用开始方法。见官网说明(默认true)
65
65
  * @property {String} separator 分隔符,colon为英文冒号,zh为中文(默认colon)
@@ -19,7 +19,7 @@ defineOptions({ name: 'u-count-to' });
19
19
  /**
20
20
  * countTo 数字滚动
21
21
  * @description 该组件一般用于需要滚动数字到某一个值的场景,目标要求是一个递增的值。
22
- * @tutorial https://uview-pro.anyup.cn/docs/components/countTo.html
22
+ * @tutorial https://uview-pro.netlify.app/components/countTo.html
23
23
  * @property {String | Number} start-val 开始值
24
24
  * @property {String | Number} end-val 结束值
25
25
  * @property {String | Number} duration 滚动过程所需的时间,单位ms(默认2000)
@@ -33,7 +33,7 @@ defineOptions({
33
33
  /**
34
34
  * divider 分割线
35
35
  * @description 区隔内容的分割线,一般用于页面底部"没有更多"的提示。
36
- * @tutorial https://uview-pro.anyup.cn/docs/components/divider.html
36
+ * @tutorial https://uview-pro.netlify.app/components/divider.html
37
37
  * @property {String Number} half-width 文字左或右边线条宽度,数值或百分比,数值时单位为rpx
38
38
  * @property {String} border-color 线条颜色,优先级高于type(默认#dcdfe6)
39
39
  * @property {String} color 文字颜色(默认#909399)
@@ -25,7 +25,7 @@ defineOptions({
25
25
  /**
26
26
  * empty 内容为空
27
27
  * @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。
28
- * @tutorial https://uview-pro.anyup.cn/docs/components/empty.html
28
+ * @tutorial https://uview-pro.netlify.app/components/empty.html
29
29
  * @property {String} color 文字颜色(默认#c0c4cc)
30
30
  * @property {String} text 文字提示(默认“无内容”)
31
31
  * @property {String} src 自定义图标路径,如定义,mode参数会失效
@@ -87,7 +87,7 @@ defineOptions({ name: 'u-field' });
87
87
  /**
88
88
  * field 输入框
89
89
  * @description 借助此组件,可以实现表单的输入, 有"text"和"textarea"类型的,此外,借助uView的picker和actionSheet组件可以快速实现上拉菜单,时间,地区选择等, 为表单解决方案的利器。
90
- * @tutorial https://uview-pro.anyup.cn/docs/components/field.html
90
+ * @tutorial https://uview-pro.netlify.app/components/field.html
91
91
  * @property {String} type 输入框的类型(默认text)
92
92
  * @property {String} icon label左边的图标,限uView的图标名称
93
93
  * @property {Object} icon-style 左边图标的样式,对象形式
@@ -12,7 +12,7 @@ defineOptions({
12
12
  /**
13
13
  * gap 间隔槽
14
14
  * @description 该组件一般用于内容块之间的用一个灰色块隔开的场景,方便用户风格统一,减少工作量
15
- * @tutorial https://uview-pro.anyup.cn/docs/components/gap.html
15
+ * @tutorial https://uview-pro.netlify.app/components/gap.html
16
16
  * @property {String} bg-color 背景颜色(默认#f3f4f6)
17
17
  * @property {String Number} height 分割槽高度,单位rpx(默认30)
18
18
  * @property {String Number} margin-top 与前一个组件的距离,单位rpx(默认0)
@@ -11,7 +11,7 @@ defineOptions({ name: 'u-grid' });
11
11
  /**
12
12
  * grid 宫格布局
13
13
  * @description 宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。
14
- * @tutorial https://uview-pro.anyup.cn/docs/components/grid.html
14
+ * @tutorial https://uview-pro.netlify.app/components/grid.html
15
15
  * @property {String|Number} col 宫格的列数(默认3)
16
16
  * @property {Boolean} border 是否显示宫格的边框(默认true)
17
17
  * @property {Boolean} hover-class 点击宫格的时候,是否显示按下的灰色背景(默认false)
@@ -24,7 +24,7 @@ defineOptions({ name: 'u-grid-item' });
24
24
  /**
25
25
  * gridItem 宫格项
26
26
  * @description 宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。搭配u-grid使用
27
- * @tutorial https://uview-pro.anyup.cn/docs/components/grid.html
27
+ * @tutorial https://uview-pro.netlify.app/components/grid.html
28
28
  * @property {String} bg-color 宫格的背景颜色(默认#ffffff)
29
29
  * @property {String|Number} index 点击宫格时,返回的值
30
30
  * @property {Object} custom-style 自定义样式,对象形式
@@ -21,7 +21,7 @@ defineOptions({
21
21
  /**
22
22
  * icon 图标
23
23
  * @description 基于字体的图标集,包含了大多数常见场景的图标。
24
- * @tutorial https://uview-pro.anyup.cn/docs/components/icon.html
24
+ * @tutorial https://uview-pro.netlify.app/components/icon.html
25
25
  * @property {String} name 图标名称,见示例图标集
26
26
  * @property {String} color 图标颜色(默认inherit)
27
27
  * @property {String | Number} size 图标字体大小,单位rpx(默认32)
@@ -35,6 +35,7 @@ defineOptions({
35
35
  * @property {String | Number} margin-top label在下方时与图标的距离,单位rpx(默认6)
36
36
  * @property {String | Number} margin-bottom label在上方时与图标的距离,单位rpx(默认6)
37
37
  * @property {String | Number} margin-right label在左侧时与图标的距离,单位rpx(默认6)
38
+ * @property {String | Number} space label与图标的距离,单位rpx,权重高于 margin
38
39
  * @property {String} index 一个用于区分多个图标的值,点击图标时通过click事件传出
39
40
  * @property {String} hover-class 图标按下去的样式类,用法同uni的view组件的hover-class参数,详情见官网
40
41
  * @property {String} width 显示图片小图标时的宽度
@@ -110,26 +111,31 @@ const props = defineProps({
110
111
  * @default '#606266'
111
112
  */
112
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' },
113
134
  /**
114
- * label与图标的距离(横向排列),单位rpx(默认6)
115
- * @default '6'
116
- */
117
- marginLeft: { type: [String, Number], default: '6' },
118
- /**
119
- * label与图标的距离(竖向排列),单位rpx(默认6)
120
- * @default '6'
121
- */
122
- marginTop: { type: [String, Number], default: '6' },
123
- /**
124
- * label与图标的距离(竖向排列),单位rpx(默认6)
125
- * @default '6'
126
- */
127
- marginRight: { type: [String, Number], default: '6' },
128
- /**
129
- * label与图标的距离(竖向排列),单位rpx(默认6)
130
- * @default '6'
135
+ * label与图标的距离,单位rpx,权重高于 margin
136
+ * @default ''
131
137
  */
132
- marginBottom: { type: [String, Number], default: '6' },
138
+ space: { type: [String, Number], default: '' },
133
139
  /**
134
140
  * 图片的mode,参考uni-app image组件
135
141
  * @default 'widthFix'
@@ -293,10 +299,10 @@ const labelStyle = computed(() => {
293
299
  return {
294
300
  color: props.labelColor,
295
301
  fontSize: $u.addUnit(props.labelSize),
296
- marginLeft: props.labelPos === 'right' ? $u.addUnit(props.marginLeft) : 0,
297
- marginTop: props.labelPos === 'bottom' ? $u.addUnit(props.marginTop) : 0,
298
- marginRight: props.labelPos === 'left' ? $u.addUnit(props.marginRight) : 0,
299
- marginBottom: props.labelPos === 'top' ? $u.addUnit(props.marginBottom) : 0
302
+ marginLeft: props.labelPos === 'right' ? $u.addUnit(props.space || props.marginLeft) : 0,
303
+ marginTop: props.labelPos === 'bottom' ? $u.addUnit(props.space || props.marginTop) : 0,
304
+ marginRight: props.labelPos === 'left' ? $u.addUnit(props.space || props.marginRight) : 0,
305
+ marginBottom: props.labelPos === 'top' ? $u.addUnit(props.space || props.marginBottom) : 0
300
306
  };
301
307
  });
302
308
 
@@ -23,7 +23,7 @@ defineOptions({
23
23
  /**
24
24
  * indexAnchor 索引列表锚点
25
25
  * @description 通过折叠面板收纳内容区域,搭配<u-index-anchor>使用
26
- * @tutorial https://uview-pro.anyup.cn/docs/components/indexList.html#indexanchor-props
26
+ * @tutorial https://uview-pro.netlify.app/components/indexList.html#indexanchor-props
27
27
  * @property {Boolean} use-slot 是否使用自定义内容的插槽(默认false)
28
28
  * @property {String|Number} index 索引字符,如果定义了use-slot,此参数自动失效
29
29
  * @property {Object} customStyle 自定义样式,对象形式,如"{color: 'red'}"
@@ -57,7 +57,7 @@ defineOptions({
57
57
  /**
58
58
  * indexList 索引列表
59
59
  * @description 通过折叠面板收纳内容区域,搭配<u-index-anchor>使用
60
- * @tutorial https://uview-pro.anyup.cn/docs/components/indexList.html#indexanchor-props
60
+ * @tutorial https://uview-pro.netlify.app/components/indexList.html#indexanchor-props
61
61
  * @property {Number|String} scroll-top 当前滚动高度,自定义组件无法获得滚动条事件,所以依赖接入方传入
62
62
  * @property {Array} index-list 索引字符列表,数组(默认A-Z)
63
63
  * @property {Number|String} z-index 锚点吸顶时的层级(默认965)
@@ -41,7 +41,7 @@ defineOptions({
41
41
  /**
42
42
  * keyboard 键盘
43
43
  * @description 此为uViw自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3中模式,都有可以打乱按键顺序的选项。
44
- * @tutorial https://uview-pro.anyup.cn/docs/components/keyboard.html
44
+ * @tutorial https://uview-pro.netlify.app/components/keyboard.html
45
45
  * @property {String} mode 键盘类型,见官网基本使用的说明(默认number)
46
46
  * @property {Boolean} dot-enabled 是否显示"."按键,只在mode=number时有效(默认true)
47
47
  * @property {Boolean} tooltip 是否显示键盘顶部工具条(默认true)
@@ -42,7 +42,7 @@ defineOptions({ name: 'u-lazy-load' });
42
42
  /**
43
43
  * lazyLoad 懒加载
44
44
  * @description 懒加载使用的场景为:页面有很多图片时,APP会同时加载所有的图片,导致页面卡顿,各个位置的图片出现前后不一致等.
45
- * @tutorial https://uview-pro.anyup.cn/docs/components/lazyLoad.html
45
+ * @tutorial https://uview-pro.netlify.app/components/lazyLoad.html
46
46
  * @property {String | Number} index 用户自定义值,在事件触发时回调,用以区分是哪个图片
47
47
  * @property {String} image 图片路径
48
48
  * @property {String} loading-img 预加载时的占位图
@@ -13,7 +13,7 @@ defineOptions({
13
13
  /**
14
14
  * line 线条
15
15
  * @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单
16
- * @tutorial https://uview-pro.anyup.cn/docs/components/line.html
16
+ * @tutorial https://uview-pro.netlify.app/components/line.html
17
17
  * @property {String} color 线条的颜色(默认#e4e7ed)
18
18
  * @property {String} length 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等
19
19
  * @property {String} direction 线条的方向,row-横向,col-竖向(默认row)
@@ -26,7 +26,7 @@ defineOptions({
26
26
  /**
27
27
  * lineProgress 线型进度条
28
28
  * @description 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
29
- * @tutorial https://uview-pro.anyup.cn/docs/components/lineProgress.html
29
+ * @tutorial https://uview-pro.netlify.app/components/lineProgress.html
30
30
  * @property {String Number} percent 进度条百分比值,为数值类型,0-100
31
31
  * @property {Boolean} round 进度条两端是否为半圆(默认true)
32
32
  * @property {String} type 如设置,active-color值将会失效
@@ -23,7 +23,7 @@ defineOptions({
23
23
  /**
24
24
  * link 超链接
25
25
  * @description 该组件为超链接组件,在不同平台有不同表现形式:在APP平台会通过plus环境打开内置浏览器,在小程序中把链接复制到粘贴板,同时提示信息,在H5中通过window.open打开链接。
26
- * @tutorial https://uview-pro.anyup.cn/docs/components/link.html
26
+ * @tutorial https://uview-pro.netlify.app/components/link.html
27
27
  * @property {String} color 文字颜色(默认#606266)
28
28
  * @property {String Number} font-size 字体大小,单位rpx(默认28)
29
29
  * @property {Boolean} under-line 是否显示下划线(默认false)
@@ -12,7 +12,7 @@ defineOptions({
12
12
  /**
13
13
  * loading 加载动画
14
14
  * @description 此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
15
- * @tutorial https://uview-pro.anyup.cn/docs/components/loading.html
15
+ * @tutorial https://uview-pro.netlify.app/components/loading.html
16
16
  * @property {String} mode 模式选择,见官网说明(默认circle)
17
17
  * @property {String} color 动画活动区域的颜色,只对 mode = flower 模式有效(默认#c7c7c7)
18
18
  * @property {String|Number} size 加载图标的大小,单位rpx(默认34)
@@ -37,7 +37,7 @@ defineOptions({ name: 'u-loadmore' });
37
37
  /**
38
38
  * loadmore 加载更多
39
39
  * @description 此组件一般用于标识页面底部加载数据时的状态。
40
- * @tutorial https://uview-pro.anyup.cn/docs/components/loadMore.html
40
+ * @tutorial https://uview-pro.netlify.app/components/loadMore.html
41
41
  * @property {String} status 组件状态(默认loadmore)
42
42
  * @property {String} bg-color 组件背景颜色,在页面是非白色时会用到(默认#ffffff)
43
43
  * @property {Boolean} icon 加载中时是否显示图标(默认true)
@@ -23,7 +23,7 @@ defineOptions({ name: 'u-mask' });
23
23
  /**
24
24
  * mask 遮罩
25
25
  * @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
26
- * @tutorial https://uview-pro.anyup.cn/docs/components/mask.html
26
+ * @tutorial https://uview-pro.netlify.app/components/mask.html
27
27
  * @property {Boolean} show 是否显示遮罩(默认false)
28
28
  * @property {String|Number} z-index z-index 层级(默认1070)
29
29
  * @property {Object} custom-style 自定义样式对象,见上方说明
@@ -63,7 +63,7 @@ defineOptions({ name: 'u-message-input' });
63
63
  /**
64
64
  * messageInput 验证码输入框
65
65
  * @description 该组件一般用于验证用户短信验证码的场景,也可以结合uView的键盘组件使用
66
- * @tutorial https://uview-pro.anyup.cn/docs/components/messageInput.html
66
+ * @tutorial https://uview-pro.netlify.app/components/messageInput.html
67
67
  * @property {String|Number} maxlength 输入字符个数(默认4)
68
68
  * @property {Boolean} dot-fill 是否用圆点填充(默认false)
69
69
  * @property {String} mode 模式选择,见上方"基本使用"说明(默认box)
@@ -56,7 +56,7 @@ defineOptions({
56
56
  /**
57
57
  * modal 模态框
58
58
  * @description 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作
59
- * @tutorial https://uview-pro.anyup.cn/docs/components/modal.html
59
+ * @tutorial https://uview-pro.netlify.app/components/modal.html
60
60
  * @property {Boolean} value 是否显示模态框
61
61
  * @property {String | Number} z-index 层级
62
62
  * @property {String} title 模态框标题(默认"提示")
@@ -47,7 +47,7 @@ defineOptions({ name: 'u-navbar' });
47
47
  /**
48
48
  * navbar 自定义导航栏
49
49
  * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
50
- * @tutorial https://uview-pro.anyup.cn/docs/components/navbar.html
50
+ * @tutorial https://uview-pro.netlify.app/components/navbar.html
51
51
  * @property {String|Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认44)
52
52
  * @property {String} back-icon-color 左边返回图标的颜色(默认#606266)
53
53
  * @property {String} back-icon-name 左边返回图标的名称,只能为uView自带的图标(默认arrow-left)
@@ -24,7 +24,7 @@ defineOptions({ name: 'u-no-network' });
24
24
  /**
25
25
  * noNetwork 无网络提示
26
26
  * @description 该组件无需任何配置,引入即可,内部自动处理所有功能和事件。
27
- * @tutorial https://uview-pro.anyup.cn/docs/components/noNetwork.html
27
+ * @tutorial https://uview-pro.netlify.app/components/noNetwork.html
28
28
  * @property {String} tips 没有网络时的提示语(默认哎呀,网络信号丢失)
29
29
  * @property {String | Number} zIndex 组件的z-index值(默认1080)
30
30
  * @property {String} image 无网络的图片提示,可用的src地址或base64图片
@@ -54,7 +54,7 @@ defineOptions({ name: 'u-notice-bar' });
54
54
  /**
55
55
  * noticeBar 滚动通知
56
56
  * @description 该组件用于滚动通告场景,有多种模式可供选择
57
- * @tutorial https://uview-pro.anyup.cn/docs/components/noticeBar.html
57
+ * @tutorial https://uview-pro.netlify.app/components/noticeBar.html
58
58
  * @property {Array} list 滚动内容,数组形式,见上方说明
59
59
  * @property {String} type 显示的主题(默认warning)
60
60
  * @property {Boolean} volumeIcon 是否显示小喇叭图标(默认true)
@@ -56,7 +56,7 @@ defineOptions({
56
56
  /**
57
57
  * numberBox 步进器
58
58
  * @description 该组件一般用于商城购物选择物品数量的场景。注意:该输入框只能输入大于或等于0的整数,不支持小数输入
59
- * @tutorial https://uview-pro.anyup.cn/docs/components/numberBox.html
59
+ * @tutorial https://uview-pro.netlify.app/components/numberBox.html
60
60
  * @property {Number} modelValue 输入框初始值(默认1)
61
61
  * @property {String} bg-color 输入框和按钮的背景颜色(默认#F2F3F5)
62
62
  * @property {Number} min 用户可输入的最小值(默认0)
@@ -114,7 +114,7 @@ defineOptions({
114
114
  /**
115
115
  * picker picker弹出选择器
116
116
  * @description 此选择器有两种弹出模式:一是时间模式,可以配置年,日,月,时,分,秒参数 二是地区模式,可以配置省,市,区参数
117
- * @tutorial https://uview-pro.anyup.cn/docs/components/picker.html
117
+ * @tutorial https://uview-pro.netlify.app/components/picker.html
118
118
  * @property {Object} params 需要显示的参数,见官网说明
119
119
  * @property {String} mode 模式选择,region-地区类型,time-时间类型(默认time)
120
120
  * @property {String Number} start-year 可选的开始年份,mode=time时有效(默认1950)
@@ -56,7 +56,7 @@ defineOptions({
56
56
  /**
57
57
  * popup 弹窗
58
58
  * @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
59
- * @tutorial https://uview-pro.anyup.cn/docs/components/popup.html
59
+ * @tutorial https://uview-pro.netlify.app/components/popup.html
60
60
  * @property {String} mode 弹出方向(默认left)
61
61
  * @property {Boolean} mask 是否显示遮罩(默认true)
62
62
  * @property {Stringr | Number} length mode=left | 见官网说明(默认auto)