stellar-ui-v2 1.40.4 → 1.40.6
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/README.md +8 -8
- package/components/ste-animate/animate.scss +247 -247
- package/components/ste-app-update/README.md +65 -0
- package/components/ste-app-update/config.json +5 -0
- package/components/ste-app-update/method.js +48 -0
- package/components/ste-app-update/ste-app-update.vue +308 -0
- package/components/ste-comment/config.json +4 -4
- package/components/ste-coupon-list/ste-coupon-list.vue +3 -1
- package/components/ste-guide-qa/README.md +115 -115
- package/components/ste-index-list/README.md +6 -6
- package/components/ste-message-box/ste-message-box.js +72 -72
- package/components/ste-navbar/README.md +125 -125
- package/components/ste-progress/README.md +16 -16
- package/components/ste-progress/ste-progress.vue +206 -206
- package/components/ste-qrcode/README.md +17 -17
- package/components/ste-qrcode/uqrcode.js +33 -33
- package/components/ste-rate/README.md +13 -13
- package/components/ste-search/README.md +5 -5
- package/components/ste-select/datetime.vue +106 -106
- package/components/ste-signature/README.md +50 -30
- package/components/ste-signature/ste-signature.vue +313 -6
- package/components/ste-slider/README.md +4 -4
- package/components/ste-stepper/README.md +14 -14
- package/components/ste-stepper/ste-stepper.vue +494 -494
- package/components/ste-swiper/README.md +29 -29
- package/components/ste-table/ste-table.vue +634 -634
- package/components/ste-table-column/checkbox-icon.vue +65 -65
- package/components/ste-table-column/common.scss +65 -65
- package/components/ste-table-column/radio-icon.vue +110 -110
- package/components/ste-table-column/sub-table.vue +116 -116
- package/components/ste-table-column/var.scss +1 -1
- package/components/ste-tabs/README.md +63 -63
- package/components/ste-tabs/props.js +212 -212
- package/components/ste-toast/ste-toast.js +69 -69
- package/components/ste-video/ste-video.vue +632 -632
- package/package.json +1 -1
- package/static/app_update_img.png +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="update-mask flex-center" v-if="open">
|
|
3
|
+
<view class="update-content">
|
|
4
|
+
<image class="update-image" src="../../static/app_update_img.png"></image>
|
|
5
|
+
|
|
6
|
+
<view class="update-title">发现新版本</view>
|
|
7
|
+
<view class="update-version">v{{ data.name }}</view>
|
|
8
|
+
<scroll-view scroll-y class="update-desc">
|
|
9
|
+
<view class="update-desc-title">更新内容</view>
|
|
10
|
+
<view class="update-desc-message"><rich-text :nodes="data.content"></rich-text></view>
|
|
11
|
+
</scroll-view>
|
|
12
|
+
<view class="update-footer">
|
|
13
|
+
<view class="update-progress-box" v-if="!updateBtn">
|
|
14
|
+
<progress class="update-progress" border-radius="35" :percent="percent" activeColor="#3DA7FF" show-info stroke-width="10" />
|
|
15
|
+
<view>
|
|
16
|
+
<text class="update-down-msg" v-if="tempFilePath">下载完成</text>
|
|
17
|
+
<text class="update-down-msg" v-else>正在下载,请稍后 ({{ downloadedSize }}/{{ packageFileSize }}M)</text>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
20
|
+
<button class="update-button" plain @click="confirm" v-if="updateBtn">{{ btnText }}</button>
|
|
21
|
+
<button class="update-button" plain @click="install" v-else-if="data.package_type === 0 && tempFilePath">安装</button>
|
|
22
|
+
</view>
|
|
23
|
+
|
|
24
|
+
<view class="update-close" v-if="!data.isForce" @click.stop="close">✖</view>
|
|
25
|
+
</view>
|
|
26
|
+
</view>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
import { download } from './method';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
group: '业务组件',
|
|
33
|
+
title: 'AppUpdate APP更新',
|
|
34
|
+
name: 'SteAppUpdate',
|
|
35
|
+
props: {
|
|
36
|
+
/** 应用编码 */
|
|
37
|
+
clientId: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: '',
|
|
40
|
+
},
|
|
41
|
+
/** 应用密钥 */
|
|
42
|
+
clientSecret: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '',
|
|
45
|
+
},
|
|
46
|
+
/** API地址 */
|
|
47
|
+
apiUrl: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail',
|
|
50
|
+
},
|
|
51
|
+
/** APP环境,版本号的最后一位为环境标识 */
|
|
52
|
+
appType: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: '',
|
|
55
|
+
},
|
|
56
|
+
/** 立即体验按钮文本 */
|
|
57
|
+
btnText: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '立即体验',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
data: {
|
|
65
|
+
content: '',
|
|
66
|
+
updateFile: '', //安装包
|
|
67
|
+
isForce: false, //是否强制更新 0代表否 1代表是
|
|
68
|
+
package_type: 0, //0 是整包升级 1是wgt升级
|
|
69
|
+
name: '1.0.1', // 版本名称
|
|
70
|
+
code: '100', // 版本号
|
|
71
|
+
},
|
|
72
|
+
open: false,
|
|
73
|
+
version: uni.getSystemInfoSync().version,
|
|
74
|
+
percent: 0,
|
|
75
|
+
updateBtn: true,
|
|
76
|
+
downloadedSize: '0',
|
|
77
|
+
packageFileSize: '0',
|
|
78
|
+
tempFilePath: '',
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
getData(callback) {
|
|
83
|
+
uni.request({
|
|
84
|
+
url: this.apiUrl,
|
|
85
|
+
method: 'GET',
|
|
86
|
+
header: {
|
|
87
|
+
Authorization: `Basic ${btoa(this.clientId + ':' + this.clientSecret)}`,
|
|
88
|
+
},
|
|
89
|
+
success: (res) => {
|
|
90
|
+
const _data = res.data;
|
|
91
|
+
if (_data.code == 200) {
|
|
92
|
+
this.data.code = _data.data.code;
|
|
93
|
+
this.data.name = _data.data.name;
|
|
94
|
+
|
|
95
|
+
this.data.content = (_data.data.desc || '').replace(/\n+/g, '<br />');
|
|
96
|
+
|
|
97
|
+
this.data.isForce = _data.data.isForce;
|
|
98
|
+
this.data.updateFile = _data.data.entireFile ? _data.data.entireFile : _data.data.updateFile;
|
|
99
|
+
this.data.package_type = _data.data.entireFile ? 0 : 1;
|
|
100
|
+
callback && callback({ code: _data.data.code, name: _data.data.name, updateFile: this.data.updateFile }, this.version);
|
|
101
|
+
if (this.appType) {
|
|
102
|
+
const nvs = this.data.name.split('.');
|
|
103
|
+
// 版本号的最后一位是环境,比较版本号最后一位版本号是否一致,不一致弹错误窗口提示
|
|
104
|
+
const nevn = nvs[nvs.length - 1];
|
|
105
|
+
if (this.appType !== nevn) {
|
|
106
|
+
uni.showModal({
|
|
107
|
+
title: '提示',
|
|
108
|
+
content: `新版本环境:${nevn}和当前环境${this.appType}不一致`,
|
|
109
|
+
showCancel: false,
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
nvs.splice(nvs.length - 1);
|
|
114
|
+
this.data.name = nvs.join('.');
|
|
115
|
+
}
|
|
116
|
+
if (this.data.updateFile && this.data.code !== this.version) {
|
|
117
|
+
this.open = true;
|
|
118
|
+
this.$emit('update');
|
|
119
|
+
// 如果是强制更新,直接开始下载
|
|
120
|
+
if (this.data.isForce) this.confirm();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
console.log(_data.msg);
|
|
125
|
+
}
|
|
126
|
+
// 无需升级
|
|
127
|
+
this.$emit('no-update');
|
|
128
|
+
},
|
|
129
|
+
fail: (err) => {
|
|
130
|
+
console.log('err===========', err);
|
|
131
|
+
this.$emit('no-update');
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
start(callback) {
|
|
137
|
+
// #ifdef APP-PLUS
|
|
138
|
+
plus.runtime.getProperty(plus.runtime.appid || '', (inf) => {
|
|
139
|
+
this.version = inf.version || '';
|
|
140
|
+
this.getData(callback);
|
|
141
|
+
});
|
|
142
|
+
// #endif
|
|
143
|
+
// #ifndef APP-PLUS
|
|
144
|
+
this.getData(callback);
|
|
145
|
+
// #endif
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
onProgressUpdate(res) {
|
|
149
|
+
this.percent = res.progress;
|
|
150
|
+
this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
|
|
151
|
+
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
confirm() {
|
|
155
|
+
if (this.data.package_type == 0) {
|
|
156
|
+
//apk整包升级 下载地址必须以.apk结尾
|
|
157
|
+
if (this.data.updateFile.includes('.apk')) {
|
|
158
|
+
this.updateBtn = false;
|
|
159
|
+
download(this.data, {
|
|
160
|
+
onProgressUpdate: this.onProgressUpdate,
|
|
161
|
+
downloadSuccess: (path) => (this.tempFilePath = path),
|
|
162
|
+
});
|
|
163
|
+
} else {
|
|
164
|
+
//外部下载 一般是手机应用市场或者其他h5页面
|
|
165
|
+
plus.runtime.openURL(this.data.updateFile);
|
|
166
|
+
uni.navigateBack({
|
|
167
|
+
delta: 1,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
this.updateBtn = false;
|
|
172
|
+
//wgt资源包升级 下载地址必须以.wgt结尾
|
|
173
|
+
download(this.data, {
|
|
174
|
+
onProgressUpdate: this.onProgressUpdate,
|
|
175
|
+
downloadSuccess: (path) => (this.tempFilePath = path),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
close() {
|
|
181
|
+
this.open = false;
|
|
182
|
+
this.$emit('cancel');
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
install() {
|
|
186
|
+
plus.runtime.install(
|
|
187
|
+
this.tempFilePath,
|
|
188
|
+
{ force: true },
|
|
189
|
+
() => {
|
|
190
|
+
// wgt升级
|
|
191
|
+
if (this.data.package_type == 1) {
|
|
192
|
+
uni.showModal({
|
|
193
|
+
title: '提示',
|
|
194
|
+
content: '升级成功,请重新启动!',
|
|
195
|
+
confirmText: '确定',
|
|
196
|
+
showCancel: false,
|
|
197
|
+
success: () => {
|
|
198
|
+
plus.runtime.restart();
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
(e) => {
|
|
204
|
+
//提示部分wgt包无法安装的问题
|
|
205
|
+
uni.showModal({
|
|
206
|
+
title: '提示',
|
|
207
|
+
content: e.message,
|
|
208
|
+
showCancel: false,
|
|
209
|
+
success: () => {},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<style lang="scss" scoped>
|
|
219
|
+
.flex-center {
|
|
220
|
+
display: flex;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
align-items: center;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.update-mask {
|
|
226
|
+
position: fixed;
|
|
227
|
+
left: 0;
|
|
228
|
+
top: 0;
|
|
229
|
+
right: 0;
|
|
230
|
+
bottom: 0;
|
|
231
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
232
|
+
z-index: 9999;
|
|
233
|
+
.update-content {
|
|
234
|
+
width: 694rpx;
|
|
235
|
+
background-color: #fff;
|
|
236
|
+
border-radius: 16rpx;
|
|
237
|
+
padding: 72rpx 40rpx 40rpx 40rpx;
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
align-items: center;
|
|
241
|
+
line-height: 1.5;
|
|
242
|
+
position: relative;
|
|
243
|
+
.update-image {
|
|
244
|
+
width: 201rpx;
|
|
245
|
+
height: 201rpx;
|
|
246
|
+
}
|
|
247
|
+
.update-title {
|
|
248
|
+
margin-top: 28rpx;
|
|
249
|
+
font-weight: 500;
|
|
250
|
+
font-size: 48rpx;
|
|
251
|
+
color: #000000;
|
|
252
|
+
}
|
|
253
|
+
.update-version {
|
|
254
|
+
font-weight: 400;
|
|
255
|
+
font-size: 34rpx;
|
|
256
|
+
color: #a7abb0;
|
|
257
|
+
}
|
|
258
|
+
.update-desc {
|
|
259
|
+
width: 100%;
|
|
260
|
+
max-height: 350rpx;
|
|
261
|
+
margin-top: 24rpx;
|
|
262
|
+
.update-desc-title {
|
|
263
|
+
font-weight: 500;
|
|
264
|
+
font-size: 32rpx;
|
|
265
|
+
color: #000000;
|
|
266
|
+
}
|
|
267
|
+
.update-desc-message {
|
|
268
|
+
font-weight: 400;
|
|
269
|
+
font-size: 28rpx;
|
|
270
|
+
color: #555a61;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.update-footer {
|
|
275
|
+
width: 100%;
|
|
276
|
+
margin-top: 48rpx;
|
|
277
|
+
.update-progress-box {
|
|
278
|
+
text-align: center;
|
|
279
|
+
font-weight: 400;
|
|
280
|
+
font-size: 34rpx;
|
|
281
|
+
color: #a7abb0;
|
|
282
|
+
}
|
|
283
|
+
.update-button {
|
|
284
|
+
width: 100%;
|
|
285
|
+
height: 96rpx;
|
|
286
|
+
line-height: 88rpx;
|
|
287
|
+
background: #1388f7;
|
|
288
|
+
border-radius: 16rpx;
|
|
289
|
+
border: 4rpx solid #1388f7;
|
|
290
|
+
font-weight: 500;
|
|
291
|
+
font-size: 32rpx;
|
|
292
|
+
color: #ffffff;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
.update-close {
|
|
296
|
+
position: absolute;
|
|
297
|
+
top: 0;
|
|
298
|
+
right: 0;
|
|
299
|
+
font-size: 30rpx;
|
|
300
|
+
color: #555a61;
|
|
301
|
+
width: 104rpx;
|
|
302
|
+
height: 96rpx;
|
|
303
|
+
line-height: 96rpx;
|
|
304
|
+
text-align: center;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
2
|
+
"group": "业务组件",
|
|
3
|
+
"title": "Comment 评价",
|
|
4
|
+
"icon": "https://image.whzb.com/chain/StellarUI/组件图标/评价.png"
|
|
5
|
+
}
|
|
@@ -4,6 +4,8 @@ import utils from '../../utils/utils.js';
|
|
|
4
4
|
let interval = 0;
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
+
group: '业务组件',
|
|
8
|
+
title: 'CouponList 券列表',
|
|
7
9
|
props: {
|
|
8
10
|
/** 基础数据 */
|
|
9
11
|
data: { type: Object, default: () => ({}) },
|
|
@@ -112,7 +114,7 @@ export default {
|
|
|
112
114
|
// #ifdef MP-ALIPAY || APP
|
|
113
115
|
drawProgressApp() {
|
|
114
116
|
// 使用uni.createCanvasContext创建绘图上下文
|
|
115
|
-
const ctx
|
|
117
|
+
const ctx = uni.createCanvasContext(this.canvasId, this);
|
|
116
118
|
|
|
117
119
|
// 设置canvas尺寸 - 根据样式定义的96rpx*48rpx
|
|
118
120
|
const canvasWidth = utils.formatPx(96, 'num');
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# GuideQA 引导服务区
|
|
2
|
-
|
|
3
|
-
问答组件,用于展示常见问题和答案
|
|
4
|
-
|
|
5
|
-
---$
|
|
6
|
-
|
|
7
|
-
### 代码演示
|
|
8
|
-
|
|
9
|
-
#### 简单模式
|
|
10
|
-
|
|
11
|
-
通过`mode="1"`设置为简单模式,默认显示模式
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<template>
|
|
15
|
-
<ste-guide-qa :data="data" @click-all="handleClickAll"></ste-guide-qa>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
1
|
+
# GuideQA 引导服务区
|
|
2
|
+
|
|
3
|
+
问答组件,用于展示常见问题和答案
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
#### 简单模式
|
|
10
|
+
|
|
11
|
+
通过`mode="1"`设置为简单模式,默认显示模式
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<template>
|
|
15
|
+
<ste-guide-qa :data="data" @click-all="handleClickAll"></ste-guide-qa>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
18
|
<script>
|
|
19
19
|
export default {
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
|
-
data: [
|
|
23
|
-
{
|
|
24
|
-
question: '如何快速上手这个组件?',
|
|
25
|
-
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
question: '支持哪些浏览器?',
|
|
29
|
-
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
question: '如何自定义样式?',
|
|
33
|
-
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
question: '遇到问题如何反馈?',
|
|
37
|
-
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
38
|
-
},
|
|
22
|
+
data: [
|
|
23
|
+
{
|
|
24
|
+
question: '如何快速上手这个组件?',
|
|
25
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
question: '支持哪些浏览器?',
|
|
29
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: '如何自定义样式?',
|
|
33
|
+
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
question: '遇到问题如何反馈?',
|
|
37
|
+
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
38
|
+
},
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
},
|
|
@@ -44,86 +44,86 @@ export default {
|
|
|
44
44
|
console.log('点击查看全部');
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
#### 完整模式
|
|
52
|
-
|
|
53
|
-
通过`mode="2"`设置为完整模式,支持点击问题和答案
|
|
54
|
-
|
|
55
|
-
```html
|
|
56
|
-
<template>
|
|
57
|
-
<ste-guide-qa :data="data" mode="2" @click-item="handleClickItem"></ste-guide-qa>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
export default {
|
|
62
|
-
data() {
|
|
63
|
-
return {
|
|
64
|
-
data: [
|
|
65
|
-
{
|
|
66
|
-
question: '如何快速上手这个组件?',
|
|
67
|
-
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
question: '支持哪些浏览器?',
|
|
71
|
-
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
question: '如何自定义样式?',
|
|
75
|
-
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
question: '遇到问题如何反馈?',
|
|
79
|
-
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
80
|
-
},
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
methods: {
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### 完整模式
|
|
52
|
+
|
|
53
|
+
通过`mode="2"`设置为完整模式,支持点击问题和答案
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<template>
|
|
57
|
+
<ste-guide-qa :data="data" mode="2" @click-item="handleClickItem"></ste-guide-qa>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
export default {
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
data: [
|
|
65
|
+
{
|
|
66
|
+
question: '如何快速上手这个组件?',
|
|
67
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
question: '支持哪些浏览器?',
|
|
71
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
question: '如何自定义样式?',
|
|
75
|
+
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
question: '遇到问题如何反馈?',
|
|
79
|
+
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
85
|
const handleClickItem(type, item) {
|
|
86
86
|
console.log(`点击了${type === 'q' ? '问题' : '答案'}:`, item);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</script>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### 自定义标题
|
|
94
|
-
|
|
95
|
-
通过`title`设置标题文本,`actionTitle`设置操作按钮文本
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<template>
|
|
99
|
-
<ste-guide-qa :data="data" title="帮助中心" actionTitle="查看更多" @click-all="handleClickAll"></ste-guide-qa>
|
|
100
|
-
</template>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
#### 是否显示数量
|
|
104
|
-
|
|
105
|
-
通过`showNum`控制是否显示数量
|
|
106
|
-
|
|
107
|
-
```html
|
|
108
|
-
<template>
|
|
109
|
-
<ste-guide-qa :data="data" :showNum="false"></ste-guide-qa>
|
|
110
|
-
</template>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
---$
|
|
114
|
-
|
|
115
|
-
### API
|
|
116
|
-
|
|
117
|
-
<!-- props -->
|
|
118
|
-
|
|
119
|
-
#### Slots
|
|
120
|
-
|
|
121
|
-
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
122
|
-
| ---------- | -------- | -------- | -------- |
|
|
123
|
-
| `prefix-q` | 问题前缀 | - | - |
|
|
124
|
-
| `prefix-a` | 答案前缀 | - | - |
|
|
125
|
-
|
|
126
|
-
---$
|
|
127
|
-
{{fuyuwei}}
|
|
128
|
-
|
|
129
|
-
{{qinpengfei}}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### 自定义标题
|
|
94
|
+
|
|
95
|
+
通过`title`设置标题文本,`actionTitle`设置操作按钮文本
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<template>
|
|
99
|
+
<ste-guide-qa :data="data" title="帮助中心" actionTitle="查看更多" @click-all="handleClickAll"></ste-guide-qa>
|
|
100
|
+
</template>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### 是否显示数量
|
|
104
|
+
|
|
105
|
+
通过`showNum`控制是否显示数量
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<template>
|
|
109
|
+
<ste-guide-qa :data="data" :showNum="false"></ste-guide-qa>
|
|
110
|
+
</template>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---$
|
|
114
|
+
|
|
115
|
+
### API
|
|
116
|
+
|
|
117
|
+
<!-- props -->
|
|
118
|
+
|
|
119
|
+
#### Slots
|
|
120
|
+
|
|
121
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
122
|
+
| ---------- | -------- | -------- | -------- |
|
|
123
|
+
| `prefix-q` | 问题前缀 | - | - |
|
|
124
|
+
| `prefix-a` | 答案前缀 | - | - |
|
|
125
|
+
|
|
126
|
+
---$
|
|
127
|
+
{{fuyuwei}}
|
|
128
|
+
|
|
129
|
+
{{qinpengfei}}
|
|
@@ -111,12 +111,12 @@ methods: {
|
|
|
111
111
|
|
|
112
112
|
#### IndexList Props
|
|
113
113
|
|
|
114
|
-
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
-
| --- |--- | --- | --- | --- | --- |
|
|
116
|
-
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
-
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
-
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
-
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
114
|
+
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
+
| --- |--- | --- | --- | --- | --- |
|
|
116
|
+
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
+
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
+
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
+
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
120
120
|
| `activeColor` | 右边锚点状态激活时的颜色 | `String` | `#0090FF` | - | - |
|
|
121
121
|
|
|
122
122
|
#### IndexList Events
|