vue-element-ui-x 0.2.1 → 1.0.1

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 (81) hide show
  1. package/README.md +8 -8
  2. package/lib/components/Attachments/index.js +8 -8
  3. package/lib/components/Bubble/index.js +116 -113
  4. package/lib/components/BubbleList/index.js +137 -134
  5. package/lib/components/Conversations/index.js +14368 -14360
  6. package/lib/components/FilesCard/index.js +4 -4
  7. package/lib/components/Prompts/index.js +4 -4
  8. package/lib/components/Sender/index.js +1594 -1448
  9. package/lib/components/Thinking/index.js +155 -15
  10. package/lib/components/ThoughtChain/index.js +121 -118
  11. package/lib/components/Typewriter/index.js +111 -108
  12. package/lib/components/Welcome/index.js +4 -4
  13. package/lib/index.common.js +1 -1
  14. package/lib/index.esm.js +1 -1
  15. package/lib/index.js +704 -236
  16. package/lib/index.umd.js +1 -1
  17. package/lib/locale/index.js +97 -0
  18. package/lib/locale/lang/ar-SA.js +18 -0
  19. package/lib/locale/lang/ar-SA.umd.js +26 -0
  20. package/lib/locale/lang/ar.js +18 -0
  21. package/lib/locale/lang/ar.umd.js +26 -0
  22. package/lib/locale/lang/de-DE.js +18 -0
  23. package/lib/locale/lang/de-DE.umd.js +26 -0
  24. package/lib/locale/lang/de.js +18 -0
  25. package/lib/locale/lang/de.umd.js +26 -0
  26. package/lib/locale/lang/en.js +18 -0
  27. package/lib/locale/lang/en.umd.js +26 -0
  28. package/lib/locale/lang/es-ES.js +18 -0
  29. package/lib/locale/lang/es-ES.umd.js +26 -0
  30. package/lib/locale/lang/es.js +18 -0
  31. package/lib/locale/lang/es.umd.js +26 -0
  32. package/lib/locale/lang/fr-FR.js +18 -0
  33. package/lib/locale/lang/fr-FR.umd.js +26 -0
  34. package/lib/locale/lang/fr.js +18 -0
  35. package/lib/locale/lang/fr.umd.js +26 -0
  36. package/lib/locale/lang/index.js +50 -0
  37. package/lib/locale/lang/it-IT.js +18 -0
  38. package/lib/locale/lang/it-IT.umd.js +26 -0
  39. package/lib/locale/lang/it.js +18 -0
  40. package/lib/locale/lang/it.umd.js +26 -0
  41. package/lib/locale/lang/ja-JP.js +18 -0
  42. package/lib/locale/lang/ja-JP.umd.js +26 -0
  43. package/lib/locale/lang/ja.js +18 -0
  44. package/lib/locale/lang/ja.umd.js +26 -0
  45. package/lib/locale/lang/ko-KR.js +18 -0
  46. package/lib/locale/lang/ko-KR.umd.js +26 -0
  47. package/lib/locale/lang/ko.js +18 -0
  48. package/lib/locale/lang/ko.umd.js +26 -0
  49. package/lib/locale/lang/pt-BR.js +18 -0
  50. package/lib/locale/lang/pt-BR.umd.js +26 -0
  51. package/lib/locale/lang/ru-RU.js +18 -0
  52. package/lib/locale/lang/ru-RU.umd.js +26 -0
  53. package/lib/locale/lang/zh-CN.js +18 -0
  54. package/lib/locale/lang/zh-CN.umd.js +26 -0
  55. package/lib/locale/lang/zh-TW.js +18 -0
  56. package/lib/locale/lang/zh-TW.umd.js +26 -0
  57. package/lib/locale/mixin.js +9 -0
  58. package/package.json +6 -4
  59. package/src/components/Bubble/src/main.vue +299 -299
  60. package/src/components/Conversations/src/main.vue +9 -3
  61. package/src/components/Sender/src/main.vue +12 -3
  62. package/src/components/Thinking/src/main.vue +10 -5
  63. package/src/index.js +25 -10
  64. package/src/locale/index.js +97 -0
  65. package/src/locale/lang/ar.js +18 -0
  66. package/src/locale/lang/de.js +18 -0
  67. package/src/locale/lang/en.js +18 -0
  68. package/src/locale/lang/es.js +18 -0
  69. package/src/locale/lang/fr.js +18 -0
  70. package/src/locale/lang/index.js +62 -0
  71. package/src/locale/lang/it.js +18 -0
  72. package/src/locale/lang/ja.js +18 -0
  73. package/src/locale/lang/ko.js +18 -0
  74. package/src/locale/lang/pt-br.js +18 -0
  75. package/src/locale/lang/ru-RU.js +18 -0
  76. package/src/locale/lang/zh-CN.js +18 -0
  77. package/src/locale/lang/zh-TW.js +18 -0
  78. package/src/locale/mixin.js +9 -0
  79. package/src/styles/Bubble.scss +157 -157
  80. package/src/styles/Conversations.scss +260 -260
  81. package/src/styles/Sender.scss +196 -199
@@ -1,299 +1,299 @@
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="avatarSize"
32
- :src="avatar"
33
- :shape="avatarShape"
34
- :icon="avatarIcon"
35
- :src-set="avatarSrcSet"
36
- :alt="avatarAlt"
37
- @error="avatarError"
38
- />
39
- </div>
40
- <!-- 头像属性进行占位 -->
41
- <div
42
- v-if="!($scopedSlots.avatar || $slots.avatar) && !avatar && avatarSize"
43
- class="el-x-bubble-avatar-placeholder"
44
- />
45
-
46
- <div
47
- v-if="$scopedSlots.avatar || $slots.avatar"
48
- class="el-x-bubble-avatar"
49
- >
50
- <slot name="avatar" />
51
- </div>
52
-
53
- <!-- 内容 -->
54
- <div class="el-x-bubble-content-wrapper">
55
- <!-- 头部内容 -->
56
- <div
57
- v-if="$scopedSlots.header || $slots.header"
58
- class="el-x-bubble-header"
59
- >
60
- <slot name="header" />
61
- </div>
62
-
63
- <div
64
- class="el-x-bubble-content"
65
- :class="{
66
- 'el-x-bubble-content-loading': loading,
67
- 'el-x-bubble-content-round': shape === 'round',
68
- 'el-x-bubble-content-corner': shape === 'corner',
69
- 'el-x-bubble-content-filled': variant === 'filled',
70
- 'el-x-bubble-content-borderless': variant === 'borderless',
71
- 'el-x-bubble-content-outlined': variant === 'outlined',
72
- 'el-x-bubble-content-shadow': variant === 'shadow',
73
- }"
74
- >
75
- <div
76
- v-if="!loading"
77
- class="el-typewriter"
78
- :class="{
79
- 'no-content': !content,
80
- }"
81
- >
82
- <el-x-typewriter
83
- v-if="!($scopedSlots.content || $slots.content) && content"
84
- ref="typewriterRef"
85
- :typing="_typing"
86
- :content="content"
87
- :is-markdown="isMarkdown"
88
- :is-fog="isFog"
89
- @start="onStart"
90
- @writing="onWriting"
91
- @finish="onFinish"
92
- />
93
- </div>
94
-
95
- <!-- 内容-自定义 -->
96
- <slot
97
- v-if="!internalDestroyed && ($scopedSlots.content || $slots.content) && !loading"
98
- name="content"
99
- />
100
-
101
- <!-- 加载中-默认 -->
102
- <div
103
- v-if="loading && !($scopedSlots.loading || $slots.loading)"
104
- class="el-x-bubble-loading-wrap"
105
- >
106
- <div
107
- v-for="(_, index) in dots"
108
- :key="index"
109
- class="dot"
110
- :style="{ animationDelay: `${index * 0.2}s` }"
111
- />
112
- </div>
113
-
114
- <!-- 加载中-自定义 -->
115
- <div
116
- v-if="loading && ($scopedSlots.loading || $slots.loading)"
117
- class="el-x-bubble-loading-wrap"
118
- >
119
- <slot name="loading" />
120
- </div>
121
- </div>
122
-
123
- <div
124
- v-if="$scopedSlots.footer || $slots.footer"
125
- class="el-x-bubble-footer"
126
- >
127
- <slot name="footer" />
128
- </div>
129
- </div>
130
- </div>
131
- </template>
132
- <script>
133
- import ElXTypewriter from '../../Typewriter/index';
134
-
135
- export default {
136
- name: 'ElXBubble',
137
- components: {
138
- ElXTypewriter,
139
- },
140
- props: {
141
- content: {
142
- type: String,
143
- default: '',
144
- },
145
- reasoning_content: {
146
- type: String,
147
- default: '',
148
- },
149
- avatar: {
150
- type: String,
151
- default: '',
152
- },
153
- placement: {
154
- type: String,
155
- default: 'start',
156
- },
157
- variant: {
158
- type: String,
159
- default: 'filled',
160
- },
161
- maxWidth: {
162
- type: String,
163
- default: '500px',
164
- },
165
- avatarSize: {
166
- type: Number,
167
- default: 0,
168
- },
169
- avatarGap: {
170
- type: Number,
171
- default: 12,
172
- },
173
- avatarShape: {
174
- type: String,
175
- default: 'circle',
176
- },
177
- avatarIcon: {
178
- type: String,
179
- default: '',
180
- },
181
- avatarSrcSet: {
182
- type: String,
183
- default: '',
184
- },
185
- avatarAlt: {
186
- type: String,
187
- default: '',
188
- },
189
- avatarFit: {
190
- type: String,
191
- default: 'cover',
192
- },
193
- noStyle: {
194
- type: Boolean,
195
- default: false,
196
- },
197
- typing: {
198
- type: [Boolean, Object],
199
- default: undefined,
200
- },
201
- loading: {
202
- type: Boolean,
203
- default: false,
204
- },
205
- shape: {
206
- type: String,
207
- default: '',
208
- },
209
- isMarkdown: {
210
- type: Boolean,
211
- default: false,
212
- },
213
- isFog: {
214
- type: Boolean,
215
- default: false,
216
- },
217
- },
218
- data() {
219
- return {
220
- internalDestroyed: false,
221
- isTypingClass: false,
222
- };
223
- },
224
- computed: {
225
- _step() {
226
- if (typeof this.typing === 'object' && this.typing.step) return this.typing.step;
227
- return 2;
228
- },
229
- _suffix() {
230
- if (typeof this.typing === 'object' && this.typing.suffix) return this.typing.suffix;
231
- return '|';
232
- },
233
- _interval() {
234
- if (typeof this.typing === 'object' && this.typing.interval) return this.typing.interval;
235
- return 50;
236
- },
237
- _typing() {
238
- if (typeof this.typing === 'undefined') {
239
- return false;
240
- } else if (typeof this.typing === 'boolean') {
241
- return this.typing;
242
- } else {
243
- return {
244
- suffix: this._suffix,
245
- step: this._step,
246
- interval: this._interval,
247
- };
248
- }
249
- },
250
- dots() {
251
- return [1, 2, 3];
252
- },
253
- },
254
- watch: {
255
- content(newVal, oldVal) {
256
- if (newVal !== oldVal && this.internalDestroyed) {
257
- this.restart();
258
- }
259
- },
260
- },
261
- methods: {
262
- onStart(instance) {
263
- this.$emit('start', instance);
264
- },
265
- onFinish(instance) {
266
- this.isTypingClass = false;
267
- this.$emit('finish', instance);
268
- },
269
- onWriting(instance) {
270
- this.isTypingClass = true;
271
- this.$emit('writing', instance);
272
- },
273
- avatarError(e) {
274
- this.$emit('avatarError', e);
275
- },
276
- interrupt() {
277
- this.$refs.typewriterRef && this.$refs.typewriterRef.interrupt();
278
- },
279
- continueTyping() {
280
- this.$refs.typewriterRef && this.$refs.typewriterRef.continueTyping();
281
- },
282
- restart() {
283
- this.internalDestroyed = false;
284
- this.$refs.typewriterRef && this.$refs.typewriterRef.restart();
285
- },
286
- destroy() {
287
- this.$refs.typewriterRef && this.$refs.typewriterRef.destroy();
288
- this.internalDestroyed = true;
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="avatarSize"
32
+ :src="avatar"
33
+ :shape="avatarShape"
34
+ :icon="avatarIcon"
35
+ :src-set="avatarSrcSet"
36
+ :alt="avatarAlt"
37
+ @error="avatarError"
38
+ />
39
+ </div>
40
+ <!-- 头像属性进行占位 -->
41
+ <div
42
+ v-if="!($scopedSlots.avatar || $slots.avatar) && !avatar && avatarSize"
43
+ class="el-x-bubble-avatar-placeholder"
44
+ />
45
+
46
+ <div
47
+ v-if="$scopedSlots.avatar || $slots.avatar"
48
+ class="el-x-bubble-avatar"
49
+ >
50
+ <slot name="avatar" />
51
+ </div>
52
+
53
+ <!-- 内容 -->
54
+ <div class="el-x-bubble-content-wrapper">
55
+ <!-- 头部内容 -->
56
+ <div
57
+ v-if="$scopedSlots.header || $slots.header"
58
+ class="el-x-bubble-header"
59
+ >
60
+ <slot name="header" />
61
+ </div>
62
+
63
+ <div
64
+ class="el-x-bubble-content"
65
+ :class="{
66
+ 'el-x-bubble-content-loading': loading,
67
+ 'el-x-bubble-content-round': shape === 'round',
68
+ 'el-x-bubble-content-corner': shape === 'corner',
69
+ 'el-x-bubble-content-filled': variant === 'filled',
70
+ 'el-x-bubble-content-borderless': variant === 'borderless',
71
+ 'el-x-bubble-content-outlined': variant === 'outlined',
72
+ 'el-x-bubble-content-shadow': variant === 'shadow',
73
+ }"
74
+ >
75
+ <div
76
+ v-if="!loading"
77
+ class="el-typewriter"
78
+ :class="{
79
+ 'no-content': !content,
80
+ }"
81
+ >
82
+ <el-x-typewriter
83
+ v-if="!($scopedSlots.content || $slots.content) && content"
84
+ ref="typewriterRef"
85
+ :typing="_typing"
86
+ :content="content"
87
+ :is-markdown="isMarkdown"
88
+ :is-fog="isFog"
89
+ @start="onStart"
90
+ @writing="onWriting"
91
+ @finish="onFinish"
92
+ />
93
+ </div>
94
+
95
+ <!-- 内容-自定义 -->
96
+ <slot
97
+ v-if="!internalDestroyed && ($scopedSlots.content || $slots.content) && !loading"
98
+ name="content"
99
+ />
100
+
101
+ <!-- 加载中-默认 -->
102
+ <div
103
+ v-if="loading && !($scopedSlots.loading || $slots.loading)"
104
+ class="el-x-bubble-loading-wrap"
105
+ >
106
+ <div
107
+ v-for="(_, index) in dots"
108
+ :key="index"
109
+ class="dot"
110
+ :style="{ animationDelay: `${index * 0.2}s` }"
111
+ />
112
+ </div>
113
+
114
+ <!-- 加载中-自定义 -->
115
+ <div
116
+ v-if="loading && ($scopedSlots.loading || $slots.loading)"
117
+ class="el-x-bubble-loading-wrap"
118
+ >
119
+ <slot name="loading" />
120
+ </div>
121
+ </div>
122
+
123
+ <div
124
+ v-if="$scopedSlots.footer || $slots.footer"
125
+ class="el-x-bubble-footer"
126
+ >
127
+ <slot name="footer" />
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </template>
132
+ <script>
133
+ import ElXTypewriter from '../../Typewriter/index';
134
+
135
+ export default {
136
+ name: 'ElXBubble',
137
+ components: {
138
+ ElXTypewriter,
139
+ },
140
+ props: {
141
+ content: {
142
+ type: String,
143
+ default: '',
144
+ },
145
+ reasoning_content: {
146
+ type: String,
147
+ default: '',
148
+ },
149
+ avatar: {
150
+ type: String,
151
+ default: '',
152
+ },
153
+ placement: {
154
+ type: String,
155
+ default: 'start',
156
+ },
157
+ variant: {
158
+ type: String,
159
+ default: 'filled',
160
+ },
161
+ maxWidth: {
162
+ type: String,
163
+ default: '500px',
164
+ },
165
+ avatarSize: {
166
+ type: Number,
167
+ default: 0,
168
+ },
169
+ avatarGap: {
170
+ type: Number,
171
+ default: 12,
172
+ },
173
+ avatarShape: {
174
+ type: String,
175
+ default: 'circle',
176
+ },
177
+ avatarIcon: {
178
+ type: String,
179
+ default: '',
180
+ },
181
+ avatarSrcSet: {
182
+ type: String,
183
+ default: '',
184
+ },
185
+ avatarAlt: {
186
+ type: String,
187
+ default: '',
188
+ },
189
+ avatarFit: {
190
+ type: String,
191
+ default: 'cover',
192
+ },
193
+ noStyle: {
194
+ type: Boolean,
195
+ default: false,
196
+ },
197
+ typing: {
198
+ type: [Boolean, Object],
199
+ default: undefined,
200
+ },
201
+ loading: {
202
+ type: Boolean,
203
+ default: false,
204
+ },
205
+ shape: {
206
+ type: String,
207
+ default: '',
208
+ },
209
+ isMarkdown: {
210
+ type: Boolean,
211
+ default: false,
212
+ },
213
+ isFog: {
214
+ type: Boolean,
215
+ default: false,
216
+ },
217
+ },
218
+ data() {
219
+ return {
220
+ internalDestroyed: false,
221
+ isTypingClass: false,
222
+ };
223
+ },
224
+ computed: {
225
+ _step() {
226
+ if (typeof this.typing === 'object' && this.typing.step) return this.typing.step;
227
+ return 2;
228
+ },
229
+ _suffix() {
230
+ if (typeof this.typing === 'object' && this.typing.suffix) return this.typing.suffix;
231
+ return '|';
232
+ },
233
+ _interval() {
234
+ if (typeof this.typing === 'object' && this.typing.interval) return this.typing.interval;
235
+ return 50;
236
+ },
237
+ _typing() {
238
+ if (typeof this.typing === 'undefined') {
239
+ return false;
240
+ } else if (typeof this.typing === 'boolean') {
241
+ return this.typing;
242
+ } else {
243
+ return {
244
+ suffix: this._suffix,
245
+ step: this._step,
246
+ interval: this._interval,
247
+ };
248
+ }
249
+ },
250
+ dots() {
251
+ return [1, 2, 3];
252
+ },
253
+ },
254
+ watch: {
255
+ content(newVal, oldVal) {
256
+ if (newVal !== oldVal && this.internalDestroyed) {
257
+ this.restart();
258
+ }
259
+ },
260
+ },
261
+ methods: {
262
+ onStart(instance) {
263
+ this.$emit('start', instance);
264
+ },
265
+ onFinish(instance) {
266
+ this.isTypingClass = false;
267
+ this.$emit('finish', instance);
268
+ },
269
+ onWriting(instance) {
270
+ this.isTypingClass = true;
271
+ this.$emit('writing', instance);
272
+ },
273
+ avatarError(e) {
274
+ this.$emit('avatarError', e);
275
+ },
276
+ interrupt() {
277
+ this.$refs.typewriterRef && this.$refs.typewriterRef.interrupt();
278
+ },
279
+ continueTyping() {
280
+ this.$refs.typewriterRef && this.$refs.typewriterRef.continueTyping();
281
+ },
282
+ restart() {
283
+ this.internalDestroyed = false;
284
+ this.$refs.typewriterRef && this.$refs.typewriterRef.restart();
285
+ },
286
+ destroy() {
287
+ this.$refs.typewriterRef && this.$refs.typewriterRef.destroy();
288
+ this.internalDestroyed = true;
289
+ },
290
+ },
291
+ beforeDestroy() {
292
+ this.destroy();
293
+ },
294
+ };
295
+ </script>
296
+
297
+ <style lang="scss" scoped>
298
+ @import '../../../styles/Bubble.scss';
299
+ </style>
@@ -193,9 +193,7 @@
193
193
  export default {
194
194
  name: 'ElXConversations',
195
195
 
196
- components: {
197
- ConversationsItem,
198
- },
196
+ components: { ConversationsItem },
199
197
 
200
198
  props: {
201
199
  items: {
@@ -549,6 +547,14 @@
549
547
  loadMoreData() {
550
548
  if (!this.loadMore) return;
551
549
  this.loadMore();
550
+ // 确保loading元素可见
551
+ this.$nextTick(() => {
552
+ const scrollContainer = this.$refs.scrollContainer;
553
+ if (scrollContainer) {
554
+ // 滚动到底部,确保loading元素可见
555
+ scrollContainer.scrollTop = scrollContainer.scrollHeight;
556
+ }
557
+ });
552
558
  },
553
559
 
554
560
  scrollToTop() {
@@ -56,7 +56,7 @@
56
56
  :autosize="computedAutoSize"
57
57
  type="textarea"
58
58
  :validate-event="false"
59
- :placeholder="placeholder"
59
+ :placeholder="computedPlaceholder"
60
60
  :readonly="readOnly || disabled"
61
61
  :disabled="disabled"
62
62
  @keydown.native="handleKeyDown"
@@ -163,6 +163,7 @@
163
163
  v-model="popoverVisible"
164
164
  :disabled="disabled"
165
165
  :visible-arrow="false"
166
+ :appendToBody="false"
166
167
  :placement="triggerPopoverPlacement"
167
168
  :offset="triggerPopoverOffset"
168
169
  popper-class="el-x-sender-trigger-popover"
@@ -185,6 +186,7 @@
185
186
  </template>
186
187
 
187
188
  <script>
189
+ import Locale from '../../../locale/mixin';
188
190
  import ClearButton from './components/ClearButton.vue';
189
191
  import LoadingButton from './components/LoadingButton.vue';
190
192
  import SendButton from './components/SendButton.vue';
@@ -193,6 +195,7 @@
193
195
 
194
196
  export default {
195
197
  name: 'ElXSender',
198
+ mixins: [Locale],
196
199
 
197
200
  components: {
198
201
  ClearButton,
@@ -209,7 +212,7 @@
209
212
  },
210
213
  placeholder: {
211
214
  type: String,
212
- default: '请输入内容',
215
+ default: '',
213
216
  },
214
217
  autoSize: {
215
218
  type: Object,
@@ -344,6 +347,11 @@
344
347
  maxRows: 6,
345
348
  };
346
349
  },
350
+
351
+ // 计算 placeholder
352
+ computedPlaceholder() {
353
+ return this.placeholder || this.elXt('el_x.sender.placeholder');
354
+ },
347
355
  },
348
356
 
349
357
  watch: {
@@ -479,8 +487,9 @@
479
487
 
480
488
  // 设置默认基础样式
481
489
  const defaultStyles = {
490
+ width: this.inputWidth || '100%',
491
+ height: '24px',
482
492
  maxHeight: '176px',
483
- maxWidth: this.inputWidth || '100%',
484
493
  boxSizing: 'border-box',
485
494
  };
486
495