stellar-ui-plus 1.18.0 → 1.18.2
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/components/ste-badge/README.md +3 -3
- package/components/ste-barcode/encode.ts +16 -16
- package/components/ste-calendar/README.md +46 -46
- package/components/ste-checkbox/README.md +6 -6
- package/components/ste-dropdown-menu/README.md +5 -3
- package/components/ste-icon/ste-icon.vue +1 -1
- package/components/ste-image/README.md +10 -10
- package/components/ste-index-list/README.md +12 -12
- package/components/ste-input/README.md +1 -0
- package/components/ste-loading/README.md +5 -5
- package/components/ste-loading/ste-loading.vue +1 -1
- package/components/ste-message-box/README.md +3 -3
- package/components/ste-notice-bar/README.md +4 -4
- package/components/ste-popup/README.md +5 -3
- package/components/ste-progress/README.md +1 -1
- package/components/ste-qrcode/uqrcode.js +33 -33
- package/components/ste-radio/README.md +6 -6
- package/components/ste-rate/README.md +12 -12
- package/components/ste-rate/ste-rate.vue +1 -1
- package/components/ste-read-more/README.md +2 -0
- package/components/ste-rich-text/README.md +1 -1
- package/components/ste-rich-text/ste-rich-text.vue +12 -2
- package/components/ste-scroll-to/README.md +1 -1
- package/components/ste-search/README.md +27 -27
- package/components/ste-select/README.md +34 -34
- package/components/ste-signature/README.md +5 -5
- package/components/ste-slider/README.md +1 -1
- package/components/ste-slider/useData.ts +4 -4
- package/components/ste-stepper/README.md +5 -5
- package/components/ste-steps/README.md +3 -3
- package/components/ste-switch/README.md +1 -1
- package/components/ste-switch/ste-switch.vue +2 -1
- package/components/ste-table/README.md +2 -0
- package/components/ste-tabs/README.md +1 -1
- package/components/ste-toast/README.md +9 -9
- package/components/ste-touch-swipe/README.md +8 -8
- package/components/ste-upload/README.md +42 -42
- package/package.json +1 -1
- package/store/color.ts +7 -1
- package/utils/System.ts +124 -97
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Badge 徽标
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
在右上角展示徽标数字或小红点
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
7
|
### 代码演示
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- 以下代码公共样式
|
|
10
10
|
|
|
11
11
|
```css
|
|
12
12
|
.avator {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
通过`background`属性,设置徽标内容的背景
|
|
39
39
|
|
|
40
|
-
-
|
|
40
|
+
- 支持纯色、渐变色、背景图
|
|
41
41
|
|
|
42
42
|
```html
|
|
43
43
|
<ste-badge content="1" background="rgb(19, 183, 22)">
|
|
@@ -172,7 +172,7 @@ export function stringToCode128(text: string) {
|
|
|
172
172
|
|
|
173
173
|
codes = codes.concat(codesForChar(b1, b2, barc.currcs))
|
|
174
174
|
// code C takes 2 chars each time
|
|
175
|
-
if (barc.currcs === CODESET.C)
|
|
175
|
+
if (barc.currcs === CODESET.C)
|
|
176
176
|
i++
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -203,7 +203,7 @@ export function stringToCode128(text: string) {
|
|
|
203
203
|
function perhapsCodeC(bytes: number[], codeset: number) {
|
|
204
204
|
for (let i = 0; i < bytes.length; i++) {
|
|
205
205
|
const b = bytes[i]
|
|
206
|
-
if ((b < 48 || b > 57) && b !== CHAR_TILDE)
|
|
206
|
+
if ((b < 48 || b > 57) && b !== CHAR_TILDE)
|
|
207
207
|
return codeset
|
|
208
208
|
}
|
|
209
209
|
return CODESET.C
|
|
@@ -221,13 +221,13 @@ export function stringToCode128(text: string) {
|
|
|
221
221
|
if (chr2 === -1) {
|
|
222
222
|
shifter === SET_CODEB
|
|
223
223
|
currcs = CODESET.B
|
|
224
|
-
}
|
|
224
|
+
}
|
|
225
225
|
else if (chr2 !== -1 && !charCompatible(chr2, currcs)) {
|
|
226
226
|
// need to check ahead as well
|
|
227
227
|
if (charCompatible(chr2, CODESET.A)) {
|
|
228
228
|
shifter = SET_CODEA
|
|
229
229
|
currcs = CODESET.A
|
|
230
|
-
}
|
|
230
|
+
}
|
|
231
231
|
else {
|
|
232
232
|
shifter = SET_CODEB
|
|
233
233
|
currcs = CODESET.B
|
|
@@ -235,7 +235,7 @@ export function stringToCode128(text: string) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
/* eslint-enable no-unused-expressions */
|
|
238
|
-
}
|
|
238
|
+
}
|
|
239
239
|
else {
|
|
240
240
|
// if there is a next char AND that next char is also not compatible
|
|
241
241
|
|
|
@@ -251,11 +251,11 @@ export function stringToCode128(text: string) {
|
|
|
251
251
|
currcs = CODESET.A
|
|
252
252
|
break
|
|
253
253
|
}
|
|
254
|
-
}
|
|
254
|
+
}
|
|
255
255
|
else {
|
|
256
256
|
// no need to shift code sets, a temporary SHIFT will suffice
|
|
257
257
|
shifter = SET_SHIFT
|
|
258
|
-
}
|
|
258
|
+
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
// ok some type of shift is nessecary
|
|
@@ -263,12 +263,12 @@ export function stringToCode128(text: string) {
|
|
|
263
263
|
result.push(shifter)
|
|
264
264
|
// result.push(codeValue(chr2));-----------------------------------
|
|
265
265
|
result.push(codeValue(chr1))
|
|
266
|
-
}
|
|
266
|
+
}
|
|
267
267
|
else {
|
|
268
268
|
if (currcs === CODESET.C) {
|
|
269
269
|
// include next as well
|
|
270
270
|
result.push(codeValue(chr1, chr2))
|
|
271
|
-
}
|
|
271
|
+
}
|
|
272
272
|
else {
|
|
273
273
|
result.push(codeValue(chr1))
|
|
274
274
|
}
|
|
@@ -284,19 +284,19 @@ function codeValue(chr1: number, chr2: any = undefined) {
|
|
|
284
284
|
if (typeof chr2 === 'undefined')
|
|
285
285
|
return chr1 >= 32 ? chr1 - 32 : chr1 + 64
|
|
286
286
|
else
|
|
287
|
-
return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
|
|
287
|
+
return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
function charCompatible(chr: number, codeset: number) {
|
|
291
291
|
const csa = codeSetAllowedFor(chr)
|
|
292
|
-
if (csa === CODESET.ANY)
|
|
292
|
+
if (csa === CODESET.ANY)
|
|
293
293
|
return true
|
|
294
294
|
// if we need to change from current
|
|
295
|
-
if (csa === CODESET.AB)
|
|
295
|
+
if (csa === CODESET.AB)
|
|
296
296
|
return true
|
|
297
|
-
if (csa === CODESET.A && codeset === CODESET.A)
|
|
297
|
+
if (csa === CODESET.A && codeset === CODESET.A)
|
|
298
298
|
return true
|
|
299
|
-
if (csa === CODESET.B && codeset === CODESET.B)
|
|
299
|
+
if (csa === CODESET.B && codeset === CODESET.B)
|
|
300
300
|
return true
|
|
301
301
|
return false
|
|
302
302
|
}
|
|
@@ -305,11 +305,11 @@ function codeSetAllowedFor(chr: number) {
|
|
|
305
305
|
if (chr >= 48 && chr <= 57) {
|
|
306
306
|
// 0-9
|
|
307
307
|
return CODESET.ANY
|
|
308
|
-
}
|
|
308
|
+
}
|
|
309
309
|
else if (chr >= 32 && chr <= 95) {
|
|
310
310
|
// 0-9 A-Z
|
|
311
311
|
return CODESET.AB
|
|
312
|
-
}
|
|
312
|
+
}
|
|
313
313
|
else {
|
|
314
314
|
// if non printable
|
|
315
315
|
return chr < 32 ? CODESET.A : CODESET.B
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Calendar 日历
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
此组件用于单个选择日期,范围选择日期等
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
7
|
### 基础用法
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- 属性`height`用于设置日历的高度,单位为`rpx`,默认`100%`
|
|
10
|
+
- 属性`showTitle`用于设置是否显示日历的标题,默认`true`
|
|
11
|
+
- 属性`title`用户设置日历的标题,默认`日期选择`
|
|
12
|
+
- 事件`confirm`用于监听用户点击确定按钮事件,参数为选中的日期数组
|
|
13
13
|
|
|
14
14
|
```html
|
|
15
15
|
<script setup lang="ts">
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
|
|
64
64
|
#### 多个日期
|
|
65
65
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
66
|
+
- 属性`mode`用于设置日历的模式,可选值`single`、`multiple`、`range`,默认`single`
|
|
67
|
+
- 设置为`multiple`可以选择多个日期
|
|
68
68
|
|
|
69
69
|
```html
|
|
70
70
|
<ste-button @click="show2 = true">多个日期</ste-button>
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
|
|
78
78
|
#### 日期范围
|
|
79
79
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
80
|
+
- 属性`mode`用于设置日历的模式,可选值`single`、`multiple`、`range`,默认`single`
|
|
81
|
+
- 设置为`single`可以选择日期范围
|
|
82
82
|
|
|
83
83
|
```html
|
|
84
84
|
<ste-button @click="show3 = true">日期范围</ste-button>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
|
|
92
92
|
#### 自定义主题色
|
|
93
93
|
|
|
94
|
-
-
|
|
94
|
+
- 属性`color`可以设置日历的主题色,包括周末日期颜色、日期选中颜色、日期范围选中颜色、确定按钮颜色
|
|
95
95
|
|
|
96
96
|
```html
|
|
97
97
|
<ste-button @click="show4 = true">自定义主题色</ste-button>
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
|
|
105
105
|
#### 自定义文案
|
|
106
106
|
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
107
|
+
- 属性`title`可以设置标题文案
|
|
108
|
+
- 属性`startText`可以设置开始日期的文案,`mode`值为`range`时生效
|
|
109
|
+
- 属性`endText`可以设置结束日期的文案,`mode`值为`range`时生效
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
112
|
<ste-button @click="show5 = true">自定义文案</ste-button>
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
|
|
120
120
|
#### 日期最大范围
|
|
121
121
|
|
|
122
|
-
-
|
|
123
|
-
-
|
|
122
|
+
- 属性`minDate`可以设置日期的最小可选范围
|
|
123
|
+
- 属性`maxDate`可以设置日期的最大可选范围
|
|
124
124
|
|
|
125
125
|
```html
|
|
126
126
|
<ste-button @click="show6 = true">日期最大范围</ste-button>
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
|
|
134
134
|
#### 多选数量限制
|
|
135
135
|
|
|
136
|
-
-
|
|
136
|
+
- 属性`maxCount`用于设置多选模式下最多可选的日期数量
|
|
137
137
|
|
|
138
138
|
```html
|
|
139
139
|
<ste-button @click="show7 = true">多选数量限制</ste-button>
|
|
@@ -146,9 +146,9 @@
|
|
|
146
146
|
|
|
147
147
|
#### 多选数量限制
|
|
148
148
|
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
149
|
+
- 属性`maxRange`用于设置范围模式下最多可选的日期数量
|
|
150
|
+
- 属性`showRangePrompt`用于设置范围模式下是否显示超出数量时的提示文案
|
|
151
|
+
- 属性`rangePrompt`用于设置范围模式下超出数量时的提示文案
|
|
152
152
|
|
|
153
153
|
```html
|
|
154
154
|
<ste-button @click="show8 = true">范围数量限制</ste-button>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
|
|
162
162
|
#### 默认选择日期
|
|
163
163
|
|
|
164
|
-
-
|
|
164
|
+
- 属性`list`用于设置默认选择的日期
|
|
165
165
|
|
|
166
166
|
```html
|
|
167
167
|
<ste-button @click="show9 = true">默认选择日期</ste-button>
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
|
|
175
175
|
#### 默认展示月份
|
|
176
176
|
|
|
177
|
-
-
|
|
177
|
+
- 属性`defaultMonth`用于设置默认展示的月份,因为弹窗中的日历不在文档流,无法设置滚动距离,所以需要在弹窗动画结束之后手动设置默认展示的月份
|
|
178
178
|
|
|
179
179
|
```html
|
|
180
180
|
<ste-button @click="show10 = true">默认展示月份</ste-button>
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
|
|
188
188
|
#### 隐藏确定按钮
|
|
189
189
|
|
|
190
|
-
-
|
|
191
|
-
-
|
|
190
|
+
- 属性`showConfirm`用于设置是否显示确定按钮
|
|
191
|
+
- 事件`select`用于监听选择日期的事件
|
|
192
192
|
|
|
193
193
|
```html
|
|
194
194
|
<ste-button @click="show11 = true">隐藏确定按钮</ste-button>
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
|
|
202
202
|
#### 只读
|
|
203
203
|
|
|
204
|
-
-
|
|
204
|
+
- 属性`readonly`用于设置是否只读
|
|
205
205
|
|
|
206
206
|
```html
|
|
207
207
|
<ste-button @click="show12 = true">只读</ste-button>
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
|
|
215
215
|
#### 隐藏背景月份
|
|
216
216
|
|
|
217
|
-
-
|
|
217
|
+
- 属性`showMark`用于设置是否显示背景月份
|
|
218
218
|
|
|
219
219
|
```html
|
|
220
220
|
<ste-button @click="show13 = true">隐藏背景月份</ste-button>
|
|
@@ -224,6 +224,7 @@
|
|
|
224
224
|
</div>
|
|
225
225
|
</ste-popup>
|
|
226
226
|
```
|
|
227
|
+
|
|
227
228
|
#### 自定义组件
|
|
228
229
|
|
|
229
230
|
- 属性`weekendColor`用于设置周末日期颜色
|
|
@@ -232,33 +233,32 @@
|
|
|
232
233
|
|
|
233
234
|
```html
|
|
234
235
|
<script setup>
|
|
235
|
-
import { ref, reactive } from 'vue';
|
|
236
|
-
import type { SignType } from '@/uni_modules/stellar-ui-plus/components/ste-calendar/date';
|
|
237
|
-
import utils from '@/uni_modules/stellar-ui-plus/utils/utils';
|
|
238
|
-
const defaultDate = ref(utils.dayjs().format('YYYY-MM'));
|
|
239
|
-
const signs = reactive<{ [key: string]: SignType }>({
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
});
|
|
236
|
+
import { ref, reactive } from 'vue';
|
|
237
|
+
import type { SignType } from '@/uni_modules/stellar-ui-plus/components/ste-calendar/date';
|
|
238
|
+
import utils from '@/uni_modules/stellar-ui-plus/utils/utils';
|
|
239
|
+
const defaultDate = ref(utils.dayjs().format('YYYY-MM'));
|
|
240
|
+
const signs = reactive<{ [key: string]: SignType }>({
|
|
241
|
+
// 标记今天
|
|
242
|
+
[utils.dayjs().format('YYYY-MM-DD')]: [
|
|
243
|
+
{ content: 'XXXXX', className: 'test-signs' },
|
|
244
|
+
{ content: 'XXXXX', className: 'test-signs' },
|
|
245
|
+
{ content: 'XXXXX', className: 'test-signs' },
|
|
246
|
+
],
|
|
247
|
+
// 标记明天
|
|
248
|
+
[utils.dayjs(Date.now() + 1000 * 60 * 60 * 24).format('YYYY-MM-DD')]: [
|
|
249
|
+
{ content: 'XXXXX', style: { color: '#666', background: '#f5f5f5' } },
|
|
250
|
+
{ content: 'XXXXX', style: { color: '#666', background: '#f5f5f5' } },
|
|
251
|
+
],
|
|
252
|
+
});
|
|
252
253
|
</script>
|
|
253
254
|
<template>
|
|
254
255
|
<ste-select mode="month" v-model="defaultDate" width="200" options-width="420" border-color="transparency">
|
|
255
256
|
<template v-slot:icon>
|
|
256
257
|
<ste-icon code=""></ste-icon>
|
|
257
|
-
|
|
258
|
-
</ste-select>
|
|
258
|
+
</template>
|
|
259
|
+
</ste-select>
|
|
259
260
|
|
|
260
|
-
<ste-calendar @select="handleConfirm" weekendColor="#999" color="#09f" :signs="signs" :defaultDate="defaultDate"
|
|
261
|
-
:monthCount="1" :showConfirm="false" :showTitle="false" />
|
|
261
|
+
<ste-calendar @select="handleConfirm" weekendColor="#999" color="#09f" :signs="signs" :defaultDate="defaultDate" :monthCount="1" :showConfirm="false" :showTitle="false" />
|
|
262
262
|
</template>
|
|
263
263
|
```
|
|
264
264
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Checkbox 复选框
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
在一组备选项中进行多选
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -187,9 +187,9 @@
|
|
|
187
187
|
|
|
188
188
|
#### 自定义文本
|
|
189
189
|
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
190
|
+
- 通过设置 `textSize` 属性可以自定义文本的大小,单位`rpx`,默认`28`。
|
|
191
|
+
- 通过设置 `textInactiveColor` 属性可以自定义文本未选中颜色,默认`#000000`。
|
|
192
|
+
- 通过设置 `textActiveColor` 属性可以自定义文本选中颜色,默认`#000000`。
|
|
193
193
|
|
|
194
194
|
```
|
|
195
195
|
<ste-checkbox v-model="val.value14" textSize="50" textInactiveColor="green" textActiveColor="#d276a3">
|
|
@@ -199,8 +199,8 @@
|
|
|
199
199
|
|
|
200
200
|
#### 回调事件
|
|
201
201
|
|
|
202
|
-
-
|
|
203
|
-
-
|
|
202
|
+
- `click` 点击复选框时触发的事件(可拦截change事件),`value`:改变后的分值,`allowStop`:允许阻止后续的事件触发,:`resolve`:后续的事件执行。
|
|
203
|
+
- `change` 当绑定值变化时触发的事件,`value`:改变后的分值。
|
|
204
204
|
|
|
205
205
|
```
|
|
206
206
|
<ste-checkbox v-model="val.value16" @click="click1" @change="change">复选框</ste-checkbox>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# DropdownMenu 下拉菜单
|
|
2
2
|
|
|
3
|
+
该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
4
|
+
|
|
3
5
|
---$
|
|
4
6
|
|
|
5
7
|
### 代码演示
|
|
6
8
|
|
|
7
9
|
#### 基础使用
|
|
8
10
|
|
|
9
|
-
-
|
|
11
|
+
- 可以通过`v-model`绑定选中值
|
|
10
12
|
|
|
11
13
|
```html
|
|
12
14
|
<view>
|
|
@@ -27,8 +29,8 @@
|
|
|
27
29
|
|
|
28
30
|
#### 按钮类型
|
|
29
31
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
+
- 默认是列表形式展示选项
|
|
33
|
+
- 当`type`值为`round`时选项为按钮形式
|
|
32
34
|
> > > 推荐选项名称字数小于6个字时使用按钮类型,过长的字会导致截断
|
|
33
35
|
|
|
34
36
|
```html
|
|
@@ -50,7 +50,7 @@ function handleClick(event: any) {
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<view class="ste-icon-root" :style="[cmpCssVar]" @click="handleClick">{{ cmpCode }}</view>
|
|
53
|
+
<view class="ste-icon-root" :style="[cmpCssVar]" @click="handleClick" data-test="icon">{{ cmpCode }}</view>
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
56
|
<style lang="scss" scoped>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Image 图片
|
|
2
2
|
|
|
3
|
-
图片组件,对原生`image
|
|
3
|
+
图片组件,对原生`image`组件进行了扩展
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
#### 基础用法
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
11
|
+
- 通过`src`属性设置图片地址
|
|
12
|
+
- 通过`width`属性设置图片宽度
|
|
13
|
+
- 通过`height`属性设置图片高度
|
|
14
|
+
- 通过`mode`属性设置图片的裁剪和拉伸
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
17
|
<ste-image src="https://image.whzb.com/chain/StellarUI/图片.jpg" width="200" height="200" />
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
#### 圆角
|
|
25
25
|
|
|
26
|
-
-
|
|
26
|
+
- 通过`radius`属性设置图片圆角属性
|
|
27
27
|
|
|
28
28
|
```html
|
|
29
29
|
<ste-image src="https://image.whzb.com/chain/StellarUI/图片.jpg" radius="50%" width="200" height="200" />
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
#### 加载效果
|
|
33
33
|
|
|
34
|
-
-
|
|
34
|
+
- 通过`hiddenLoading`关闭图片加载中占位标识
|
|
35
35
|
|
|
36
36
|
```html
|
|
37
37
|
<script setup lang="ts">
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
#### 加载失败
|
|
63
63
|
|
|
64
|
-
-
|
|
64
|
+
- 通过`hiddenError`隐藏图片加载失败提示
|
|
65
65
|
|
|
66
66
|
```html
|
|
67
67
|
<script setup lang="ts">
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
|
|
92
92
|
#### 具名插槽
|
|
93
93
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
94
|
+
- 通过`loading`具名插槽可以自定义加载中内容
|
|
95
|
+
- 通过`error`具名插槽可以自定义加载失败内容
|
|
96
96
|
|
|
97
97
|
```html
|
|
98
98
|
<ste-image :src="errorUrl" width="200" height="200">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# IndexList 索引列表
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
通过折叠面板收纳内容区域
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
|
|
45
45
|
#### 基础用法
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
47
|
+
- 标签`ste-index-list`为外层盒子
|
|
48
|
+
- 事件`clickItem`监听点击索引分组事件
|
|
49
|
+
- 标签`ste-index-item`为索引分组
|
|
50
|
+
- 属性`title`为当前索引分组标题
|
|
51
|
+
- 属性`list`为当前索引分组内容列表
|
|
52
52
|
|
|
53
53
|
```html
|
|
54
54
|
<ste-index-list @clickItem="onClickItem">
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
|
|
64
64
|
#### 自定义颜色/标题/内容
|
|
65
65
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
66
|
+
- 标签`ste-index-list`为外层盒子
|
|
67
|
+
- 属性`inactiveColor`为索引分组标题未选中颜色
|
|
68
|
+
- 属性`activeColor`为索引分组标题选中颜色
|
|
69
|
+
- 标签`ste-index-item`为索引分组
|
|
70
|
+
- 插槽`title`为当前索引分组标题
|
|
71
|
+
- 插槽`default`为当前索引分组内容列表
|
|
72
72
|
|
|
73
73
|
```html
|
|
74
74
|
<ste-index-list inactiveColor="#0f0" activeColor="#f0f">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Loading 加载动画
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
加载动画,用于表示加载中的过渡状态
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
通过 `type`设置加载动画类型,默认为类型`1`
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- `1`:逐渐减淡的颜色为主色的透明度变化 透明度以10%的差距逐渐递减
|
|
14
|
+
- `2`:动态转圈展示
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
17
|
<ste-loading></ste-loading>
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
|
|
57
57
|
### 自定义文本样式
|
|
58
58
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
59
|
+
- 通过 `textSize`设置文本大小,单位rpx,默认为`28`
|
|
60
|
+
- 通过 `textColor`设置文本颜色,默认和图标颜色同步
|
|
61
61
|
|
|
62
62
|
```html
|
|
63
63
|
<ste-loading :textSize="50" textColor="#0090FF">加载中...</ste-loading>
|
|
@@ -46,7 +46,7 @@ const cmpText = computed(() => {
|
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
48
|
<template>
|
|
49
|
-
<view class="ste-loading-root" :style="[cmpStyle]">
|
|
49
|
+
<view class="ste-loading-root" :style="[cmpStyle]" data-test="loading">
|
|
50
50
|
<view :class="'loading ' + 'loading-type-' + type" :style="[cmpLoadinStyle]">
|
|
51
51
|
<block v-if="type == 1">
|
|
52
52
|
<i v-for="(item, index) in cmpCount" :key="index" class="i" :style="{ transform: `rotate(${item * 40 + 80}deg)`, opacity: item == 0 ? 1 : (item + 1) / 10 }"></i>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MessageBox 弹框
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
模拟系统的消息提示框而实现的一套模态对话框组件,用于消息提示、确认消息和提交内容
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -88,8 +88,8 @@ function click() {
|
|
|
88
88
|
|
|
89
89
|
#### 带图标
|
|
90
90
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
91
|
+
- 内置三种图标类型:`info`、`success`、`error`
|
|
92
|
+
- 当显示图标时,内容(`content`)会失效,只显示标题(`title`)
|
|
93
93
|
|
|
94
94
|
```javascript
|
|
95
95
|
function msgBoxIcon1() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NoticeBar 公告栏
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用于循环播放展示一组消息通知
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
@@ -25,9 +25,9 @@ let list2 = ref(['第一条:111', '第二条:222', '第三条:333', '第四条:4
|
|
|
25
25
|
|
|
26
26
|
#### 自定义样式
|
|
27
27
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
- 通过 `color` 属性设置文字颜色,默认为 `#000000`。
|
|
29
|
+
- 通过 `background` 属性设置背景,默认为 `#ffffff`。
|
|
30
|
+
- 通过 `width` 属性设置宽度,默认为 `100%`,继承父属性。
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
<ste-notice-bar :list="list" background="#FBF8DC" color="red" :width="400"></ste-notice-bar>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Popup 弹出层
|
|
2
2
|
|
|
3
|
+
弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
|
|
4
|
+
|
|
3
5
|
---$
|
|
4
6
|
|
|
5
7
|
### 代码演示
|
|
@@ -37,8 +39,8 @@
|
|
|
37
39
|
|
|
38
40
|
#### 大小
|
|
39
41
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
+
- 默认弹出层的内容区域是没有高度的,如果不设置宽高则会由内容撑开
|
|
43
|
+
- 支持具体数值(单位为rpx)、百分比
|
|
42
44
|
|
|
43
45
|
```html
|
|
44
46
|
<ste-popup v-model:show="sizeShow1" width="300" height="500">
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
|
|
71
73
|
#### 圆角
|
|
72
74
|
|
|
73
|
-
-
|
|
75
|
+
- 若组件圆角不满足需求,可以不设置圆角,在插槽内容中自己设置圆角
|
|
74
76
|
|
|
75
77
|
```html
|
|
76
78
|
<ste-popup v-model:show="roundShow" width="300" height="300" round>
|