vue-element-ui-x 0.2.2 → 1.0.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/lib/components/Attachments/index.js +18 -18
- package/lib/components/Bubble/index.js +145 -155
- package/lib/components/BubbleList/index.js +180 -207
- package/lib/components/Conversations/index.js +14370 -14370
- package/lib/components/FilesCard/index.js +5 -5
- package/lib/components/Prompts/index.js +25 -25
- package/lib/components/Sender/index.js +1606 -1459
- package/lib/components/Thinking/index.js +157 -23
- package/lib/components/ThoughtChain/index.js +143 -144
- package/lib/components/Typewriter/index.js +124 -125
- package/lib/components/Welcome/index.js +5 -5
- package/lib/index.common.js +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +817 -389
- package/lib/index.umd.js +1 -1
- package/lib/locale/index.js +97 -0
- package/lib/locale/lang/ar-SA.js +18 -0
- package/lib/locale/lang/ar-SA.umd.js +26 -0
- package/lib/locale/lang/ar.js +18 -0
- package/lib/locale/lang/ar.umd.js +26 -0
- package/lib/locale/lang/de-DE.js +18 -0
- package/lib/locale/lang/de-DE.umd.js +26 -0
- package/lib/locale/lang/de.js +18 -0
- package/lib/locale/lang/de.umd.js +26 -0
- package/lib/locale/lang/en.js +18 -0
- package/lib/locale/lang/en.umd.js +26 -0
- package/lib/locale/lang/es-ES.js +18 -0
- package/lib/locale/lang/es-ES.umd.js +26 -0
- package/lib/locale/lang/es.js +18 -0
- package/lib/locale/lang/es.umd.js +26 -0
- package/lib/locale/lang/fr-FR.js +18 -0
- package/lib/locale/lang/fr-FR.umd.js +26 -0
- package/lib/locale/lang/fr.js +18 -0
- package/lib/locale/lang/fr.umd.js +26 -0
- package/lib/locale/lang/index.js +50 -0
- package/lib/locale/lang/it-IT.js +18 -0
- package/lib/locale/lang/it-IT.umd.js +26 -0
- package/lib/locale/lang/it.js +18 -0
- package/lib/locale/lang/it.umd.js +26 -0
- package/lib/locale/lang/ja-JP.js +18 -0
- package/lib/locale/lang/ja-JP.umd.js +26 -0
- package/lib/locale/lang/ja.js +18 -0
- package/lib/locale/lang/ja.umd.js +26 -0
- package/lib/locale/lang/ko-KR.js +18 -0
- package/lib/locale/lang/ko-KR.umd.js +26 -0
- package/lib/locale/lang/ko.js +18 -0
- package/lib/locale/lang/ko.umd.js +26 -0
- package/lib/locale/lang/pt-BR.js +18 -0
- package/lib/locale/lang/pt-BR.umd.js +26 -0
- package/lib/locale/lang/ru-RU.js +18 -0
- package/lib/locale/lang/ru-RU.umd.js +26 -0
- package/lib/locale/lang/zh-CN.js +18 -0
- package/lib/locale/lang/zh-CN.umd.js +26 -0
- package/lib/locale/lang/zh-TW.js +18 -0
- package/lib/locale/lang/zh-TW.umd.js +26 -0
- package/lib/locale/mixin.js +9 -0
- package/package.json +15 -10
- package/src/components/Attachments/src/main.vue +2 -10
- package/src/components/Bubble/src/main.vue +288 -299
- package/src/components/BubbleList/src/main.vue +2 -19
- package/src/components/Conversations/src/main.vue +0 -41
- package/src/components/Prompts/src/main.vue +248 -248
- package/src/components/Sender/src/components/LoadingButton.vue +37 -39
- package/src/components/Sender/src/components/SpeechLoadingButton.vue +41 -43
- package/src/components/Sender/src/main.vue +13 -3
- package/src/components/Thinking/src/main.vue +13 -9
- package/src/components/ThoughtChain/src/main.vue +1 -3
- package/src/components/Typewriter/src/main.vue +3 -7
- package/src/components/Welcome/src/main.vue +151 -151
- package/src/index.js +23 -6
- package/src/locale/index.js +97 -0
- package/src/locale/lang/ar.js +18 -0
- package/src/locale/lang/de.js +18 -0
- package/src/locale/lang/en.js +18 -0
- package/src/locale/lang/es.js +18 -0
- package/src/locale/lang/fr.js +18 -0
- package/src/locale/lang/index.js +62 -0
- package/src/locale/lang/it.js +18 -0
- package/src/locale/lang/ja.js +18 -0
- package/src/locale/lang/ko.js +18 -0
- package/src/locale/lang/pt-br.js +18 -0
- package/src/locale/lang/ru-RU.js +18 -0
- package/src/locale/lang/zh-CN.js +18 -0
- package/src/locale/lang/zh-TW.js +18 -0
- package/src/locale/mixin.js +9 -0
- package/src/styles/Attachments.scss +236 -236
- package/src/styles/Bubble.scss +5 -4
- package/src/styles/BubbleList.scss +148 -148
- package/src/styles/Conversations.scss +260 -260
- package/src/styles/FilesCard.scss +222 -221
- package/src/styles/Prompts.scss +197 -195
- package/src/styles/Sender.scss +207 -199
- package/src/styles/Thinking.scss +36 -6
- package/src/styles/ThoughtChain.scss +113 -113
- package/src/styles/Typewriter.scss +66 -66
- package/src/styles/var.scss +4 -5
- package/src/theme/var.scss +183 -72
|
@@ -1,299 +1,288 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="!internalDestroyed"
|
|
4
|
-
class="el-x-bubble"
|
|
5
|
-
:class="{
|
|
6
|
-
'el-x-bubble-start': placement === 'start',
|
|
7
|
-
'el-x-bubble-end': placement === 'end',
|
|
8
|
-
'el-x-bubble-no-style': noStyle,
|
|
9
|
-
'el-x-bubble-is-typing': isTypingClass,
|
|
10
|
-
}"
|
|
11
|
-
:style="{
|
|
12
|
-
'--el-box-shadow-tertiary': `0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
13
|
-
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
14
|
-
0 2px 4px 0 rgba(0, 0, 0, 0.02)`,
|
|
15
|
-
'--bubble-content-max-width': `${maxWidth}`,
|
|
16
|
-
'--el-x-bubble-avatar-placeholder-width': `${
|
|
17
|
-
$scopedSlots.avatar || $slots.avatar ? '' : avatarSize + 'px'
|
|
18
|
-
}`,
|
|
19
|
-
'--el-x-bubble-avatar-placeholder-height': `${
|
|
20
|
-
$scopedSlots.avatar || $slots.avatar ? '' : avatarSize + 'px'
|
|
21
|
-
}`,
|
|
22
|
-
'--el-x-bubble-avatar-placeholder-gap': `${avatarGap}px`,
|
|
23
|
-
}"
|
|
24
|
-
>
|
|
25
|
-
<!-- 头像 -->
|
|
26
|
-
<div
|
|
27
|
-
v-if="!($scopedSlots.avatar || $slots.avatar) && avatar"
|
|
28
|
-
class="el-x-bubble-avatar el-x-bubble-avatar-size"
|
|
29
|
-
>
|
|
30
|
-
<el-avatar
|
|
31
|
-
:size="
|
|
32
|
-
:src="avatar"
|
|
33
|
-
:shape="avatarShape"
|
|
34
|
-
:
|
|
35
|
-
:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class="
|
|
65
|
-
|
|
66
|
-
'el-x-bubble-content-
|
|
67
|
-
'el-x-bubble-content-
|
|
68
|
-
'el-x-bubble-content-
|
|
69
|
-
'el-x-bubble-content-
|
|
70
|
-
'el-x-bubble-content-
|
|
71
|
-
'el-x-bubble-content-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class="
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
:
|
|
86
|
-
:
|
|
87
|
-
:is-
|
|
88
|
-
|
|
89
|
-
@
|
|
90
|
-
@
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.$emit('
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
this.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
this
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
beforeDestroy() {
|
|
292
|
-
this.destroy();
|
|
293
|
-
},
|
|
294
|
-
};
|
|
295
|
-
</script>
|
|
296
|
-
|
|
297
|
-
<style lang="scss" scoped>
|
|
298
|
-
@import '../../../styles/Bubble.scss';
|
|
299
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="!internalDestroyed"
|
|
4
|
+
class="el-x-bubble"
|
|
5
|
+
:class="{
|
|
6
|
+
'el-x-bubble-start': placement === 'start',
|
|
7
|
+
'el-x-bubble-end': placement === 'end',
|
|
8
|
+
'el-x-bubble-no-style': noStyle,
|
|
9
|
+
'el-x-bubble-is-typing': isTypingClass,
|
|
10
|
+
}"
|
|
11
|
+
:style="{
|
|
12
|
+
'--el-box-shadow-tertiary': `0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
13
|
+
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
14
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.02)`,
|
|
15
|
+
'--bubble-content-max-width': `${maxWidth}`,
|
|
16
|
+
'--el-x-bubble-avatar-placeholder-width': `${
|
|
17
|
+
$scopedSlots.avatar || $slots.avatar ? '' : avatarSize + 'px'
|
|
18
|
+
}`,
|
|
19
|
+
'--el-x-bubble-avatar-placeholder-height': `${
|
|
20
|
+
$scopedSlots.avatar || $slots.avatar ? '' : avatarSize + 'px'
|
|
21
|
+
}`,
|
|
22
|
+
'--el-x-bubble-avatar-placeholder-gap': `${avatarGap}px`,
|
|
23
|
+
}"
|
|
24
|
+
>
|
|
25
|
+
<!-- 头像 -->
|
|
26
|
+
<div
|
|
27
|
+
v-if="!($scopedSlots.avatar || $slots.avatar) && avatar"
|
|
28
|
+
class="el-x-bubble-avatar el-x-bubble-avatar-size"
|
|
29
|
+
>
|
|
30
|
+
<el-avatar
|
|
31
|
+
:size="0"
|
|
32
|
+
:src="avatar"
|
|
33
|
+
:shape="avatarShape"
|
|
34
|
+
:src-set="avatarSrcSet"
|
|
35
|
+
:alt="avatarAlt"
|
|
36
|
+
@error="avatarError"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
<!-- 头像属性进行占位 -->
|
|
40
|
+
<div
|
|
41
|
+
v-if="!($scopedSlots.avatar || $slots.avatar) && !avatar && avatarSize"
|
|
42
|
+
class="el-x-bubble-avatar-placeholder"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
v-if="$scopedSlots.avatar || $slots.avatar"
|
|
47
|
+
class="el-x-bubble-avatar"
|
|
48
|
+
>
|
|
49
|
+
<slot name="avatar" />
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- 内容 -->
|
|
53
|
+
<div class="el-x-bubble-content-wrapper">
|
|
54
|
+
<!-- 头部内容 -->
|
|
55
|
+
<div
|
|
56
|
+
v-if="$scopedSlots.header || $slots.header"
|
|
57
|
+
class="el-x-bubble-header"
|
|
58
|
+
>
|
|
59
|
+
<slot name="header" />
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div
|
|
63
|
+
class="el-x-bubble-content"
|
|
64
|
+
:class="{
|
|
65
|
+
'el-x-bubble-content-loading': loading,
|
|
66
|
+
'el-x-bubble-content-round': shape === 'round' && !noStyle,
|
|
67
|
+
'el-x-bubble-content-corner': shape === 'corner' && !noStyle,
|
|
68
|
+
'el-x-bubble-content-filled': variant === 'filled' && !noStyle,
|
|
69
|
+
'el-x-bubble-content-borderless': variant === 'borderless' && !noStyle,
|
|
70
|
+
'el-x-bubble-content-outlined': variant === 'outlined' && !noStyle,
|
|
71
|
+
'el-x-bubble-content-shadow': variant === 'shadow' && !noStyle,
|
|
72
|
+
}"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
v-if="!loading"
|
|
76
|
+
class="el-typewriter"
|
|
77
|
+
:class="{
|
|
78
|
+
'no-content': !content,
|
|
79
|
+
}"
|
|
80
|
+
>
|
|
81
|
+
<el-x-typewriter
|
|
82
|
+
v-if="!($scopedSlots.content || $slots.content) && content"
|
|
83
|
+
ref="typewriterRef"
|
|
84
|
+
:typing="_typing"
|
|
85
|
+
:content="content"
|
|
86
|
+
:is-markdown="isMarkdown"
|
|
87
|
+
:is-fog="isFog"
|
|
88
|
+
@start="onStart"
|
|
89
|
+
@writing="onWriting"
|
|
90
|
+
@finish="onFinish"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- 内容-自定义 -->
|
|
95
|
+
<slot
|
|
96
|
+
v-if="!internalDestroyed && ($scopedSlots.content || $slots.content) && !loading"
|
|
97
|
+
name="content"
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<!-- 加载中-默认 -->
|
|
101
|
+
<div
|
|
102
|
+
v-if="loading && !($scopedSlots.loading || $slots.loading)"
|
|
103
|
+
class="el-x-bubble-loading-wrap"
|
|
104
|
+
>
|
|
105
|
+
<div
|
|
106
|
+
v-for="(_, index) in dots"
|
|
107
|
+
:key="index"
|
|
108
|
+
class="dot"
|
|
109
|
+
:style="{ animationDelay: `${index * 0.2}s` }"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- 加载中-自定义 -->
|
|
114
|
+
<div
|
|
115
|
+
v-if="loading && ($scopedSlots.loading || $slots.loading)"
|
|
116
|
+
class="el-x-bubble-loading-wrap"
|
|
117
|
+
>
|
|
118
|
+
<slot name="loading" />
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div
|
|
123
|
+
v-if="$scopedSlots.footer || $slots.footer"
|
|
124
|
+
class="el-x-bubble-footer"
|
|
125
|
+
>
|
|
126
|
+
<slot name="footer" />
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
<script>
|
|
132
|
+
import ElXTypewriter from '../../Typewriter/index';
|
|
133
|
+
|
|
134
|
+
export default {
|
|
135
|
+
name: 'ElXBubble',
|
|
136
|
+
components: { ElXTypewriter },
|
|
137
|
+
props: {
|
|
138
|
+
content: {
|
|
139
|
+
type: String,
|
|
140
|
+
default: '',
|
|
141
|
+
},
|
|
142
|
+
avatar: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: '',
|
|
145
|
+
},
|
|
146
|
+
placement: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: 'start',
|
|
149
|
+
},
|
|
150
|
+
variant: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: 'filled',
|
|
153
|
+
},
|
|
154
|
+
maxWidth: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: '500px',
|
|
157
|
+
},
|
|
158
|
+
avatarSize: {
|
|
159
|
+
type: Number,
|
|
160
|
+
default: 0,
|
|
161
|
+
},
|
|
162
|
+
avatarGap: {
|
|
163
|
+
type: Number,
|
|
164
|
+
default: 12,
|
|
165
|
+
},
|
|
166
|
+
avatarShape: {
|
|
167
|
+
type: String,
|
|
168
|
+
default: 'circle',
|
|
169
|
+
},
|
|
170
|
+
avatarSrcSet: {
|
|
171
|
+
type: String,
|
|
172
|
+
default: '',
|
|
173
|
+
},
|
|
174
|
+
avatarAlt: {
|
|
175
|
+
type: String,
|
|
176
|
+
default: '',
|
|
177
|
+
},
|
|
178
|
+
avatarFit: {
|
|
179
|
+
type: String,
|
|
180
|
+
default: 'cover',
|
|
181
|
+
},
|
|
182
|
+
noStyle: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: false,
|
|
185
|
+
},
|
|
186
|
+
typing: {
|
|
187
|
+
type: [Boolean, Object],
|
|
188
|
+
default: undefined,
|
|
189
|
+
},
|
|
190
|
+
loading: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: false,
|
|
193
|
+
},
|
|
194
|
+
shape: {
|
|
195
|
+
type: String,
|
|
196
|
+
default: '',
|
|
197
|
+
},
|
|
198
|
+
isMarkdown: {
|
|
199
|
+
type: Boolean,
|
|
200
|
+
default: false,
|
|
201
|
+
},
|
|
202
|
+
isFog: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: false,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
data() {
|
|
208
|
+
return {
|
|
209
|
+
internalDestroyed: false,
|
|
210
|
+
isTypingClass: false,
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
computed: {
|
|
214
|
+
_step() {
|
|
215
|
+
if (typeof this.typing === 'object' && this.typing.step) return this.typing.step;
|
|
216
|
+
return 2;
|
|
217
|
+
},
|
|
218
|
+
_suffix() {
|
|
219
|
+
if (typeof this.typing === 'object' && this.typing.suffix) return this.typing.suffix;
|
|
220
|
+
return '|';
|
|
221
|
+
},
|
|
222
|
+
_interval() {
|
|
223
|
+
if (typeof this.typing === 'object' && this.typing.interval) return this.typing.interval;
|
|
224
|
+
return 50;
|
|
225
|
+
},
|
|
226
|
+
_typing() {
|
|
227
|
+
if (typeof this.typing === 'undefined') {
|
|
228
|
+
return false;
|
|
229
|
+
} else if (typeof this.typing === 'boolean') {
|
|
230
|
+
return this.typing;
|
|
231
|
+
} else {
|
|
232
|
+
return {
|
|
233
|
+
suffix: this._suffix,
|
|
234
|
+
step: this._step,
|
|
235
|
+
interval: this._interval,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
dots() {
|
|
240
|
+
return [1, 2, 3];
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
watch: {
|
|
244
|
+
content(newVal, oldVal) {
|
|
245
|
+
if (newVal !== oldVal && this.internalDestroyed) {
|
|
246
|
+
this.restart();
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
onStart(instance) {
|
|
252
|
+
this.$emit('start', instance);
|
|
253
|
+
},
|
|
254
|
+
onFinish(instance) {
|
|
255
|
+
this.isTypingClass = false;
|
|
256
|
+
this.$emit('finish', instance);
|
|
257
|
+
},
|
|
258
|
+
onWriting(instance) {
|
|
259
|
+
this.isTypingClass = true;
|
|
260
|
+
this.$emit('writing', instance);
|
|
261
|
+
},
|
|
262
|
+
avatarError(e) {
|
|
263
|
+
this.$emit('avatarError', e);
|
|
264
|
+
},
|
|
265
|
+
interrupt() {
|
|
266
|
+
this.$refs.typewriterRef && this.$refs.typewriterRef.interrupt();
|
|
267
|
+
},
|
|
268
|
+
continueTyping() {
|
|
269
|
+
this.$refs.typewriterRef && this.$refs.typewriterRef.continueTyping();
|
|
270
|
+
},
|
|
271
|
+
restart() {
|
|
272
|
+
this.internalDestroyed = false;
|
|
273
|
+
this.$refs.typewriterRef && this.$refs.typewriterRef.restart();
|
|
274
|
+
},
|
|
275
|
+
destroy() {
|
|
276
|
+
this.$refs.typewriterRef && this.$refs.typewriterRef.destroy();
|
|
277
|
+
this.internalDestroyed = true;
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
beforeDestroy() {
|
|
281
|
+
this.destroy();
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
</script>
|
|
285
|
+
|
|
286
|
+
<style lang="scss" scoped>
|
|
287
|
+
@import '../../../styles/Bubble.scss';
|
|
288
|
+
</style>
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
:avatar-size="defaultAvatarSize || item.avatarSize"
|
|
38
38
|
:avatar-gap="defaultAvatarGap || item.avatarGap"
|
|
39
39
|
:avatar-shape="defaultAvatarShape || item.avatarShape"
|
|
40
|
-
:avatar-icon="defaultAvatarIcon || item.avatarIcon"
|
|
41
40
|
:avatar-src-set="defaultAvatarSrcSet || item.avatarSrcSet"
|
|
42
41
|
:avatar-alt="defaultAvatarAlt || item.avatarAlt"
|
|
43
42
|
:avatar-fit="defaultAvatarFit || item.avatarFit"
|
|
@@ -48,19 +47,7 @@
|
|
|
48
47
|
<slot
|
|
49
48
|
name="avatar"
|
|
50
49
|
:item="item"
|
|
51
|
-
>
|
|
52
|
-
<template v-if="defaultAvatar || item.avatar">
|
|
53
|
-
<el-avatar
|
|
54
|
-
:size="defaultAvatarSize || item.avatarSize || 40"
|
|
55
|
-
:src="defaultAvatar || item.avatar"
|
|
56
|
-
:shape="defaultAvatarShape || item.avatarShape || 'circle'"
|
|
57
|
-
:icon="defaultAvatarIcon || item.avatarIcon"
|
|
58
|
-
:src-set="defaultAvatarSrcSet || item.avatarSrcSet"
|
|
59
|
-
:alt="defaultAvatarAlt || item.avatarAlt"
|
|
60
|
-
:fit="defaultAvatarFit || item.avatarFit || 'cover'"
|
|
61
|
-
/>
|
|
62
|
-
</template>
|
|
63
|
-
</slot>
|
|
50
|
+
></slot>
|
|
64
51
|
</template>
|
|
65
52
|
<template
|
|
66
53
|
v-if="$scopedSlots.header || $slots.header"
|
|
@@ -129,9 +116,9 @@
|
|
|
129
116
|
</template>
|
|
130
117
|
|
|
131
118
|
<script>
|
|
119
|
+
import createScrollDetector from '../../../utils/scrollDetector';
|
|
132
120
|
import Bubble from '../../Bubble/index.js';
|
|
133
121
|
import loadingBg from './loading.vue';
|
|
134
|
-
import createScrollDetector from '../../../utils/scrollDetector';
|
|
135
122
|
|
|
136
123
|
export default {
|
|
137
124
|
name: 'ElXBubbleList',
|
|
@@ -232,10 +219,6 @@
|
|
|
232
219
|
type: String,
|
|
233
220
|
default: '',
|
|
234
221
|
},
|
|
235
|
-
defaultAvatarIcon: {
|
|
236
|
-
type: String,
|
|
237
|
-
default: '',
|
|
238
|
-
},
|
|
239
222
|
defaultAvatarSrcSet: {
|
|
240
223
|
type: String,
|
|
241
224
|
default: '',
|