stellar-ui-plus 1.22.18 → 1.22.20
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-app-update/ATTRIBUTES.md +1 -0
- package/components/ste-app-update/ste-app-update.vue +10 -5
- package/components/ste-comment/ATTRIBUTES.md +8 -0
- package/components/ste-comment/README.md +61 -0
- package/components/ste-comment/config.json +5 -0
- package/components/ste-comment/props.ts +28 -0
- package/components/ste-comment/ste-comment.easycom.json +26 -0
- package/components/ste-comment/ste-comment.vue +168 -0
- package/components/ste-guide-qa/ATTRIBUTES.md +15 -0
- package/components/ste-guide-qa/README.md +123 -0
- package/components/ste-guide-qa/config.json +5 -0
- package/components/ste-guide-qa/props.ts +22 -0
- package/components/ste-guide-qa/ste-guide-qa.easycom.json +58 -0
- package/components/ste-guide-qa/ste-guide-qa.vue +170 -0
- package/components/ste-login/components/loginFormItem.vue +9 -2
- package/components/ste-step/ste-step.scss +13 -0
- package/components/ste-step/ste-step.vue +2 -1
- package/components/ste-stepper/ATTRIBUTES.md +1 -1
- package/components/ste-stepper/props.ts +2 -2
- package/components/ste-stepper/ste-stepper.easycom.json +8 -0
- package/components/ste-stepper/ste-stepper.vue +40 -4
- package/components/ste-steps/ATTRIBUTES.md +1 -0
- package/components/ste-steps/props.ts +1 -0
- package/components/ste-steps/ste-steps.easycom.json +6 -0
- package/components/ste-steps/ste-steps.vue +7 -1
- package/components/ste-swiper/ATTRIBUTES.md +1 -0
- package/components/ste-swiper/README.md +73 -6
- package/components/ste-swiper/props.ts +2 -0
- package/components/ste-swiper/ste-swiper.easycom.json +7 -0
- package/components/ste-swiper/ste-swiper.vue +3 -3
- package/components/ste-swiper/useData.ts +458 -360
- package/components/ste-swiper-item/ste-swiper-item.vue +9 -2
- package/components/ste-tabs/README.md +4 -3
- package/components/ste-tabs/ste-tabs.vue +20 -5
- package/index.ts +4 -0
- package/package.json +1 -1
- package/types/components.d.ts +4 -0
- package/types/refComponents.d.ts +4 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
| `clientId` | 应用编码 | `string` | `` | - | - |
|
|
5
5
|
| `clientSecret` | 应用密钥 | `string` | `` | - | - |
|
|
6
6
|
| `apiUrl` | 更新API地址 | `string` | `https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail` | - | - |
|
|
7
|
+
| `appType` | APP环境,版本号的最后一位为环境标识 | `string` | `` | - | - |
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
#### Events
|
|
@@ -45,7 +45,7 @@ const getData = (callback?: (resVersion: { name: string; code: string; updateFil
|
|
|
45
45
|
if (_data.code == 200) {
|
|
46
46
|
data.code = _data.data.code;
|
|
47
47
|
data.name = _data.data.name;
|
|
48
|
-
data.content = _data.data.content + _data.data.desc;
|
|
48
|
+
data.content = `${_data.data.content}${_data.data.desc ? '\n' + _data.data.desc : ''}`.replaceAll('\n', '<br />');
|
|
49
49
|
data.isForce = _data.data.isForce;
|
|
50
50
|
data.updateFile = _data.data.entireFile ? _data.data.entireFile : _data.data.updateFile;
|
|
51
51
|
data.package_type = _data.data.entireFile ? 0 : 1;
|
|
@@ -63,7 +63,7 @@ const getData = (callback?: (resVersion: { name: string; code: string; updateFil
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
if (data.updateFile && data.code
|
|
66
|
+
if (data.updateFile && data.code !== version.value) {
|
|
67
67
|
open.value = true;
|
|
68
68
|
emits('update');
|
|
69
69
|
// 如果是强制更新,直接开始下载
|
|
@@ -167,8 +167,8 @@ defineExpose({
|
|
|
167
167
|
<view class="content botton-radius">
|
|
168
168
|
<view class="content-top">
|
|
169
169
|
<view class="content-top-text">
|
|
170
|
-
<text class="">发现新版本 v{{ data.
|
|
171
|
-
<text class="version">当前版本:{{ version }}</text>
|
|
170
|
+
<text class="">发现新版本 v{{ data.name }}</text>
|
|
171
|
+
<!-- <text class="version">当前版本:{{ version }}</text> -->
|
|
172
172
|
</view>
|
|
173
173
|
<image class="content-top" style="top: 0" width="100%" height="100%" src="../../static/bg_top.png"></image>
|
|
174
174
|
</view>
|
|
@@ -176,8 +176,12 @@ defineExpose({
|
|
|
176
176
|
<view class="content-body">
|
|
177
177
|
<view class="title"><text>更新内容</text></view>
|
|
178
178
|
<view class="body">
|
|
179
|
-
<scroll-view class="box-des-scroll" scroll-y
|
|
179
|
+
<scroll-view class="box-des-scroll" scroll-y>
|
|
180
|
+
<rich-text v-if="data.content" :nodes="data.content"></rich-text>
|
|
181
|
+
<text v-else>-</text>
|
|
182
|
+
</scroll-view>
|
|
180
183
|
</view>
|
|
184
|
+
|
|
181
185
|
<view class="footer">
|
|
182
186
|
<view class="progress-box flex-column" v-if="!updateBtn">
|
|
183
187
|
<progress class="progress" border-radius="35" :percent="percent" activeColor="#3DA7FF" show-info stroke-width="10" />
|
|
@@ -274,6 +278,7 @@ defineExpose({
|
|
|
274
278
|
.footer {
|
|
275
279
|
min-height: 150rpx;
|
|
276
280
|
padding-bottom: 12rpx;
|
|
281
|
+
margin-top: 24rpx;
|
|
277
282
|
}
|
|
278
283
|
|
|
279
284
|
.box-des-scroll {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Comment 评论组件
|
|
2
|
+
|
|
3
|
+
用于在商品详情页面展示评论信息
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 基础用法
|
|
8
|
+
|
|
9
|
+
- 属性`tags`用于接收顶部标签列表,默认值`[]`
|
|
10
|
+
- 属性`total`用于接收评论总数,默认值`0`
|
|
11
|
+
- 属性`comments`用于接收评论列表,默认值`[]`
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { CommentType } from '@/uni_modules/stellar-ui-plus/components/ste-comment/props';
|
|
16
|
+
import { ref } from 'vue';
|
|
17
|
+
|
|
18
|
+
const comments = ref<CommentType[]>([
|
|
19
|
+
{
|
|
20
|
+
evaluateText: '牛肉很新鲜,价格便宜,质量不错,推荐',
|
|
21
|
+
imgList: [
|
|
22
|
+
'https://image.whzb.com/chain/StellarUI/image/comment_1.png',
|
|
23
|
+
'https://image.whzb.com/chain/StellarUI/image/comment_2.png',
|
|
24
|
+
'https://image.whzb.com/chain/StellarUI/image/comment_3.png',
|
|
25
|
+
'https://image.whzb.com/chain/StellarUI/image/comment_4.png',
|
|
26
|
+
],
|
|
27
|
+
type: 1,
|
|
28
|
+
date: '2024.10.05',
|
|
29
|
+
userName: '匿名用户',
|
|
30
|
+
userAvatar: 'https://image.whzb.com/chain/StellarUI/图片.jpg',
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
const tags = ref(['牛肉很新鲜 22', '牛肉不错 13', '牛肉品质高 6']);
|
|
35
|
+
</script>
|
|
36
|
+
<template>
|
|
37
|
+
<page-layout title="用户评论" contentStyle="padding: 20rpx;background-color: #f5f5f5;">
|
|
38
|
+
<ste-comment :comments="comments" :tags="tags" :total="0"></ste-comment>
|
|
39
|
+
</page-layout>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---$
|
|
44
|
+
|
|
45
|
+
### API
|
|
46
|
+
|
|
47
|
+
<!-- props -->
|
|
48
|
+
|
|
49
|
+
#### CommentType
|
|
50
|
+
|
|
51
|
+
| 属性 | 说明 | 类型 |
|
|
52
|
+
| ------------ | ------------ | ---------- |
|
|
53
|
+
| evaluateText | 评价内容 | `string` |
|
|
54
|
+
| date | 日期 | `string` |
|
|
55
|
+
| imgList | 评价图片列表 | `string[]` |
|
|
56
|
+
| type | 1好评 2差评 | `1 / 2` |
|
|
57
|
+
| userName | 用户名 | `string` |
|
|
58
|
+
| userAvatar | 用户头像 | `string` |
|
|
59
|
+
|
|
60
|
+
---$
|
|
61
|
+
{{xuyajun}}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface CommentType extends Record<string, any> {
|
|
4
|
+
evaluateText: string;
|
|
5
|
+
imgList: string[];
|
|
6
|
+
type: 1 | 2;
|
|
7
|
+
date: string;
|
|
8
|
+
userName: string;
|
|
9
|
+
userAvatar: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
/** 标签数据 */
|
|
14
|
+
tags: {
|
|
15
|
+
type: Array as PropType<string[]>,
|
|
16
|
+
default: () => [],
|
|
17
|
+
},
|
|
18
|
+
/** 总数 */
|
|
19
|
+
total: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
/** 评论数据 */
|
|
24
|
+
comments: {
|
|
25
|
+
type: Array as PropType<CommentType[]>,
|
|
26
|
+
default: () => [],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ste-goods-info",
|
|
3
|
+
"description": "按钮组件",
|
|
4
|
+
"example": "<ste-goods-info></ste-goods-info>",
|
|
5
|
+
"tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=goods-info",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "tags",
|
|
9
|
+
"description": "标签数组",
|
|
10
|
+
"type": "string[]",
|
|
11
|
+
"default": "[]"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "total",
|
|
15
|
+
"description": "总数",
|
|
16
|
+
"type": "number",
|
|
17
|
+
"default": 0
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "comments",
|
|
21
|
+
"description": "评价数组",
|
|
22
|
+
"type": "CommentType[]",
|
|
23
|
+
"default": "[]"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import steIcon from '../ste-icon/ste-icon.vue';
|
|
4
|
+
import propsData from './props';
|
|
5
|
+
const props = defineProps(propsData);
|
|
6
|
+
const totalData = computed(() => Math.max(props.total, props.comments.length));
|
|
7
|
+
|
|
8
|
+
const headRight = computed(() => {
|
|
9
|
+
if (totalData.value === 0) {
|
|
10
|
+
return '期待你的首评';
|
|
11
|
+
}
|
|
12
|
+
return '全部评价';
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
<template>
|
|
16
|
+
<view class="ste-comment-root" :class="{ not: totalData === 0 }">
|
|
17
|
+
<view class="comment-head">
|
|
18
|
+
<view class="comment-head-title">商品评价({{ totalData }})</view>
|
|
19
|
+
<view class="comment-head-right">
|
|
20
|
+
{{ headRight }}
|
|
21
|
+
<ste-icon v-if="headRight === '全部评价'" code="" />
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="comment-content" v-if="totalData > 0 || comments.length > 0">
|
|
25
|
+
<view class="comment-tags" v-if="tags.length > 0">
|
|
26
|
+
<view class="comment-tag" v-for="(tag, index) in tags" :key="index">
|
|
27
|
+
{{ tag }}
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
<view class="comment-list">
|
|
31
|
+
<view class="comment-item" v-for="(item, index) in comments" :key="index">
|
|
32
|
+
<view class="comment-head-info">
|
|
33
|
+
<image class="comment-head-avatar" :src="item.userAvatar" mode="aspectFill" />
|
|
34
|
+
<view class="comment-head-right">
|
|
35
|
+
<view class="comment-head-name">
|
|
36
|
+
{{ item.userName }}
|
|
37
|
+
<image class="good-tag" v-if="item.type === 1" src="https://image.whzb.com/chain/StellarUI/component-icons/好评.png" />
|
|
38
|
+
</view>
|
|
39
|
+
<view class="comment-head-time">{{ item.date }}</view>
|
|
40
|
+
</view>
|
|
41
|
+
</view>
|
|
42
|
+
<view class="comment-content">
|
|
43
|
+
{{ item.evaluateText }}
|
|
44
|
+
</view>
|
|
45
|
+
<view class="comment-images">
|
|
46
|
+
<image class="comment-image" v-for="(image, index) in item.imgList" :key="index" :src="image" mode="aspectFill" />
|
|
47
|
+
</view>
|
|
48
|
+
</view>
|
|
49
|
+
</view>
|
|
50
|
+
</view>
|
|
51
|
+
</view>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<style lang="scss" scoped>
|
|
55
|
+
.ste-comment-root {
|
|
56
|
+
width: 100%;
|
|
57
|
+
background: #fff;
|
|
58
|
+
&.not {
|
|
59
|
+
background: linear-gradient(161deg, #ffffff 0%, #ffffff 42%, #fff1ed 100%);
|
|
60
|
+
}
|
|
61
|
+
.comment-head {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 92rpx;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: 0 20rpx 0 24rpx;
|
|
69
|
+
.comment-head-title {
|
|
70
|
+
font-weight: 800;
|
|
71
|
+
font-size: 32rpx;
|
|
72
|
+
color: #000000;
|
|
73
|
+
}
|
|
74
|
+
.comment-head-right {
|
|
75
|
+
font-size: 28rpx;
|
|
76
|
+
color: #858585;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.comment-content {
|
|
80
|
+
width: 100%;
|
|
81
|
+
padding: 0 24rpx 20rpx 24rpx;
|
|
82
|
+
.comment-tags {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
font-size: 24rpx;
|
|
88
|
+
color: #f65419;
|
|
89
|
+
margin-top: 4rpx;
|
|
90
|
+
.comment-tag {
|
|
91
|
+
background: rgba($color: #f65419, $alpha: 0.08);
|
|
92
|
+
padding: 10rpx 28rpx;
|
|
93
|
+
margin-right: 20rpx;
|
|
94
|
+
margin-bottom: 20rpx;
|
|
95
|
+
border-radius: 26rpx;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.comment-list {
|
|
100
|
+
width: 100%;
|
|
101
|
+
.comment-item {
|
|
102
|
+
width: 100%;
|
|
103
|
+
background: #f9f9fb;
|
|
104
|
+
border-radius: 16rpx;
|
|
105
|
+
padding: 24rpx 18rpx 16rpx 18rpx;
|
|
106
|
+
.comment-head-info {
|
|
107
|
+
width: 100%;
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
.comment-head-avatar {
|
|
112
|
+
width: 64rpx;
|
|
113
|
+
height: 64rpx;
|
|
114
|
+
border-radius: 50%;
|
|
115
|
+
}
|
|
116
|
+
.comment-head-right {
|
|
117
|
+
font-size: 24rpx;
|
|
118
|
+
line-height: 32rpx;
|
|
119
|
+
padding-left: 16rpx;
|
|
120
|
+
height: 64rpx;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
.comment-head-name {
|
|
125
|
+
color: #000000;
|
|
126
|
+
font-weight: bold;
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: row;
|
|
129
|
+
align-items: center;
|
|
130
|
+
.good-tag {
|
|
131
|
+
width: 84rpx;
|
|
132
|
+
height: 32rpx;
|
|
133
|
+
margin-left: 16rpx;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.comment-head-time {
|
|
137
|
+
color: #999999;
|
|
138
|
+
font-weight: 400;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.comment-content {
|
|
143
|
+
font-size: 28rpx;
|
|
144
|
+
color: #000000;
|
|
145
|
+
line-height: 42rpx;
|
|
146
|
+
margin-top: 18rpx;
|
|
147
|
+
margin-bottom: 16rpx;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.comment-images {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
flex-wrap: wrap;
|
|
154
|
+
.comment-image {
|
|
155
|
+
width: 150rpx;
|
|
156
|
+
height: 150rpx;
|
|
157
|
+
margin-right: 8rpx;
|
|
158
|
+
margin-bottom: 8rpx;
|
|
159
|
+
&:nth-child(4n) {
|
|
160
|
+
margin-right: 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `data` | 问答数据列表 | `GuideQaItem[]` | `[]` | - | - |
|
|
5
|
+
| `mode` | 显示模式 | `string` | `1` | `1`:简单模式<br/>`2`:完整模式 | - |
|
|
6
|
+
| `title` | 标题文本 | `string` | `常见问题` | - | - |
|
|
7
|
+
| `actionTitle` | 操作按钮文本 | `string` | `全部` | - | - |
|
|
8
|
+
| `showNum` | 是否显示问答数量 | `boolean` | `true` | - | - |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
#### Events
|
|
12
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
13
|
+
| ----- | ----- | ------- | -------- |
|
|
14
|
+
| `click-item` | 点击问题或答案时触发 | - | - |
|
|
15
|
+
| `click-all` | 点击查看全部时触发 | - | - |
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
<script setup>
|
|
19
|
+
import { ref } from 'vue';
|
|
20
|
+
|
|
21
|
+
const data = ref([
|
|
22
|
+
{
|
|
23
|
+
question: '如何快速上手这个组件?',
|
|
24
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: '支持哪些浏览器?',
|
|
28
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
question: '如何自定义样式?',
|
|
32
|
+
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
question: '遇到问题如何反馈?',
|
|
36
|
+
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const handleClickAll = () => {
|
|
41
|
+
console.log('点击查看全部');
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### 完整模式
|
|
47
|
+
|
|
48
|
+
通过`mode="2"`设置为完整模式,支持点击问题和答案
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<template>
|
|
52
|
+
<ste-guide-qa :data="data" mode="2" @click-item="handleClickItem"></ste-guide-qa>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script setup>
|
|
56
|
+
import { ref } from 'vue';
|
|
57
|
+
|
|
58
|
+
const data = ref([
|
|
59
|
+
{
|
|
60
|
+
question: '如何快速上手这个组件?',
|
|
61
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
question: '支持哪些浏览器?',
|
|
65
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
66
|
+
},
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
const handleClickItem = (type, item) => {
|
|
70
|
+
console.log(`点击了${type === 'q' ? '问题' : '答案'}:`, item);
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### 自定义标题
|
|
76
|
+
|
|
77
|
+
通过`title`设置标题文本,`actionTitle`设置操作按钮文本
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<template>
|
|
81
|
+
<ste-guide-qa :data="data" title="帮助中心" actionTitle="查看更多" @click-all="handleClickAll"></ste-guide-qa>
|
|
82
|
+
</template>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### 是否显示数量
|
|
86
|
+
|
|
87
|
+
通过`showNum`控制是否显示数量
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<template>
|
|
91
|
+
<ste-guide-qa :data="data" :showNum="false"></ste-guide-qa>
|
|
92
|
+
</template>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---$
|
|
96
|
+
|
|
97
|
+
### API
|
|
98
|
+
|
|
99
|
+
<!-- props -->
|
|
100
|
+
|
|
101
|
+
#### Slots
|
|
102
|
+
|
|
103
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
104
|
+
| ---------- | -------- | -------- | -------- |
|
|
105
|
+
| `prefix-q` | 问题前缀 | - | - |
|
|
106
|
+
| `prefix-a` | 答案前缀 | - | - |
|
|
107
|
+
|
|
108
|
+
#### Types
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
export interface GuideQaItem {
|
|
112
|
+
question: string;
|
|
113
|
+
answer: string;
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type ClickType = 'q' | 'a';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---$
|
|
121
|
+
{{fuyuwei}}
|
|
122
|
+
|
|
123
|
+
{{qinpengfei}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface GuideQaItem {
|
|
4
|
+
question: string;
|
|
5
|
+
answer: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type ClickType = 'q' | 'a';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
data: { type: Array as PropType<GuideQaItem[]>, default: () => [] },
|
|
13
|
+
mode: { type: String as PropType<'1' | '2'>, default: '1' },
|
|
14
|
+
title: { type: String, default: '常见问题' },
|
|
15
|
+
actionTitle: { type: String, default: '全部' },
|
|
16
|
+
showNum: { type: Boolean, default: true },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export interface GuideQaEmits {
|
|
20
|
+
(e: 'click-item', type: ClickType, item: GuideQaItem): void;
|
|
21
|
+
(e: 'click-all'): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ste-guide-qa",
|
|
3
|
+
"description": "引导服务区组件",
|
|
4
|
+
"example": "<ste-guide-qa :data=\"data\"></ste-guide-qa>",
|
|
5
|
+
"tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=guide-qa",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "data",
|
|
9
|
+
"description": "问答数据列表",
|
|
10
|
+
"type": "GuideQaItem[]",
|
|
11
|
+
"default": "[]"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "mode",
|
|
15
|
+
"description": "显示模式",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"values": [
|
|
18
|
+
{
|
|
19
|
+
"name": "1",
|
|
20
|
+
"description": "简单模式"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "2",
|
|
24
|
+
"description": "完整模式"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"default": "1"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "title",
|
|
31
|
+
"description": "标题文本",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "常见问题"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "actionTitle",
|
|
37
|
+
"description": "操作按钮文本",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "全部"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "showNum",
|
|
43
|
+
"description": "是否显示问答数量",
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"default": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "[event]click-item",
|
|
49
|
+
"description": "点击问题或答案时触发",
|
|
50
|
+
"type": "(type: 'q' | 'a', item: GuideQaItem) => void"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "[event]click-all",
|
|
54
|
+
"description": "点击查看全部时触发",
|
|
55
|
+
"type": "() => void"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|