vue-element-ui-x 0.2.1 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-element-ui-x",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "基于Vue 2 + Element UI的AI聊天组件库",
5
5
  "main": "lib/index.esm.js",
6
6
  "module": "lib/index.umd.js",
@@ -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() {
package/src/index.js CHANGED
@@ -41,8 +41,9 @@ const install = function (Vue) {
41
41
  });
42
42
  };
43
43
 
44
- // 具名导出(按需引入)- 组件
44
+ // 具名导出(按需引入)- 组件和Mixins
45
45
  export {
46
+ // 组件
46
47
  ElXAttachments,
47
48
  ElXBubble,
48
49
  ElXBubbleList,
@@ -54,10 +55,7 @@ export {
54
55
  ElXThoughtChain,
55
56
  ElXTypewriter,
56
57
  ElXWelcome,
57
- };
58
-
59
- // 具名导出(按需引入)- Mixins
60
- export {
58
+ // Mixins
61
59
  createSendUtils,
62
60
  createStreamUtils,
63
61
  customMixins,
@@ -1,157 +1,157 @@
1
- @import '../theme/var.scss';
2
-
3
- .el-x-bubble {
4
- display: flex;
5
- gap: var(--el-x-bubble-avatar-placeholder-gap);
6
- }
7
-
8
- .el-x-bubble-avatar-size {
9
- ::v-deep .el-avatar {
10
- width: var(--el-x-bubble-avatar-placeholder-width);
11
- height: var(--el-x-bubble-avatar-placeholder-height);
12
- }
13
- }
14
-
15
- .el-x-bubble-avatar-placeholder {
16
- width: var(--el-x-bubble-avatar-placeholder-width);
17
- height: var(--el-x-bubble-avatar-placeholder-height);
18
- }
19
-
20
- .el-x-bubble-start {
21
- .el-x-bubble-content-wrapper {
22
- .el-x-bubble-content-corner {
23
- border-start-start-radius: $--el-x-border-radius-base - 2px;
24
- }
25
- }
26
- }
27
-
28
- .el-x-bubble-end {
29
- justify-content: end;
30
- flex-direction: row-reverse;
31
-
32
- .el-x-bubble-content-wrapper {
33
- align-items: flex-end;
34
-
35
- .el-x-bubble-content-corner {
36
- border-start-end-radius: $--el-x-border-radius-base - 2px;
37
- }
38
- }
39
- }
40
-
41
- .el-x-bubble-no-style {
42
- .el-x-bubble-content-wrapper {
43
- .el-x-bubble-content {
44
- background-color: transparent;
45
- padding: 0;
46
- }
47
- }
48
- }
49
-
50
- .el-x-bubble-content-wrapper {
51
- flex: auto;
52
- display: flex;
53
- flex-direction: column;
54
- align-items: flex-start;
55
- min-width: 0;
56
- max-width: 100%;
57
-
58
- .el-x-bubble-header,
59
- .el-x-bubble-content,
60
- .el-x-bubble-footer {
61
- font-size: $--el-x-font-size-base;
62
- color: $--el-x-text-color-primary;
63
- line-height: $--el-x-font-line-height-primary;
64
- }
65
-
66
- // .el-x-bubble-header {
67
- // margin-bottom: var();
68
- // }
69
-
70
- .el-x-bubble-content {
71
- background-color: $--el-x-fill-color;
72
- padding: $--el-x-padding-md $--el-x-padding-lg;
73
- border-radius: $--el-x-border-radius-base + 4px;
74
- position: relative;
75
- box-sizing: border-box;
76
- min-width: 0;
77
- max-width: var(--bubble-content-max-width);
78
- color: $--el-x-text-color-primary;
79
- font-size: $--el-x-font-size-base;
80
- line-height: $--el-x-font-line-height-primary;
81
- // min-height: calc(#{$--el-x-padding-md} * 2 + #{$--el-x-font-line-height-primary} * #{$--el-x-font-size-base} );
82
- word-break: break-word;
83
-
84
- // 打字器没有内容时候展示高度
85
- .no-content {
86
- // height: 16px;
87
- height: 0;
88
- }
89
- }
90
-
91
- // 气泡圆角
92
- .el-x-bubble-content-round {
93
- border-radius: $--el-x-border-radius-round;
94
- }
95
-
96
- // 气泡样式
97
- .el-x-bubble-content-filled {
98
- background-color: $--el-x-fill-color;
99
- }
100
-
101
- .el-x-bubble-content-borderless {
102
- background-color: $--el-x-fill-color;
103
- border: $--el-x-border-width solid $--el-x-border-color;
104
- }
105
-
106
- .el-x-bubble-content-outlined {
107
- background: none;
108
- border: $--el-x-border-width solid $--el-x-border-color;
109
- }
110
-
111
- .el-x-bubble-content-shadow {
112
- background: none;
113
- // box-shadow: var(--el-box-shadow-tertiary);
114
- box-shadow: $--el-x-box-shadow-base;
115
- }
116
-
117
- .el-x-bubble-content-loading {
118
- width: fit-content;
119
-
120
- .el-x-bubble-loading-wrap {
121
- display: flex;
122
- justify-content: center;
123
- align-items: center;
124
- // height: 16px;
125
- /* 盒子高度 */
126
- gap: 5px;
127
- }
128
-
129
- .dot {
130
- width: 5px;
131
- height: 5px;
132
- background-color: $--color-primary;
133
- /* 点的颜色 */
134
- border-radius: 50%;
135
- /* 圆形 */
136
- animation: wave 1s infinite ease-in-out;
137
- /* 动画 */
138
- }
139
-
140
- /* 波浪动画 */
141
- @keyframes wave {
142
- 0%,
143
- 100% {
144
- transform: translateY(-2px);
145
- }
146
-
147
- 50% {
148
- transform: translateY(2px);
149
- /* 上下波动 */
150
- }
151
- }
152
- }
153
-
154
- .el-x-bubble-footer {
155
- margin-top: $--el-x-padding-sm;
156
- }
157
- }
1
+ @import '../theme/var.scss';
2
+
3
+ .el-x-bubble {
4
+ display: flex;
5
+ gap: var(--el-x-bubble-avatar-placeholder-gap);
6
+ }
7
+
8
+ .el-x-bubble-avatar-size {
9
+ ::v-deep .el-avatar {
10
+ width: var(--el-x-bubble-avatar-placeholder-width);
11
+ height: var(--el-x-bubble-avatar-placeholder-height);
12
+ }
13
+ }
14
+
15
+ .el-x-bubble-avatar-placeholder {
16
+ width: var(--el-x-bubble-avatar-placeholder-width);
17
+ height: var(--el-x-bubble-avatar-placeholder-height);
18
+ }
19
+
20
+ .el-x-bubble-start {
21
+ .el-x-bubble-content-wrapper {
22
+ .el-x-bubble-content-corner {
23
+ border-start-start-radius: $--el-x-border-radius-base - 2px;
24
+ }
25
+ }
26
+ }
27
+
28
+ .el-x-bubble-end {
29
+ justify-content: end;
30
+ flex-direction: row-reverse;
31
+
32
+ .el-x-bubble-content-wrapper {
33
+ align-items: flex-end;
34
+
35
+ .el-x-bubble-content-corner {
36
+ border-start-end-radius: $--el-x-border-radius-base - 2px;
37
+ }
38
+ }
39
+ }
40
+
41
+ .el-x-bubble-no-style {
42
+ .el-x-bubble-content-wrapper {
43
+ .el-x-bubble-content {
44
+ background-color: transparent;
45
+ padding: 0;
46
+ }
47
+ }
48
+ }
49
+
50
+ .el-x-bubble-content-wrapper {
51
+ flex: auto;
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: flex-start;
55
+ min-width: 0;
56
+ max-width: 100%;
57
+
58
+ .el-x-bubble-header,
59
+ .el-x-bubble-content,
60
+ .el-x-bubble-footer {
61
+ font-size: $--el-x-font-size-base;
62
+ color: $--el-x-text-color-primary;
63
+ line-height: $--el-x-font-line-height-primary;
64
+ }
65
+
66
+ // .el-x-bubble-header {
67
+ // margin-bottom: var();
68
+ // }
69
+
70
+ .el-x-bubble-content {
71
+ background-color: $--el-x-fill-color;
72
+ padding: $--el-x-padding-md $--el-x-padding-lg;
73
+ border-radius: $--el-x-border-radius-base + 4px;
74
+ position: relative;
75
+ box-sizing: border-box;
76
+ min-width: 0;
77
+ max-width: var(--bubble-content-max-width);
78
+ color: $--el-x-text-color-primary;
79
+ font-size: $--el-x-font-size-base;
80
+ line-height: $--el-x-font-line-height-primary;
81
+ // min-height: calc(#{$--el-x-padding-md} * 2 + #{$--el-x-font-line-height-primary} * #{$--el-x-font-size-base} );
82
+ word-break: break-word;
83
+
84
+ // 打字器没有内容时候展示高度
85
+ .no-content {
86
+ // height: 16px;
87
+ height: 0;
88
+ }
89
+ }
90
+
91
+ // 气泡圆角
92
+ .el-x-bubble-content-round {
93
+ border-radius: $--el-x-border-radius-round;
94
+ }
95
+
96
+ // 气泡样式
97
+ .el-x-bubble-content-filled {
98
+ background-color: $--el-x-fill-color;
99
+ }
100
+
101
+ .el-x-bubble-content-borderless {
102
+ background-color: $--el-x-fill-color;
103
+ border: $--el-x-border-width solid $--el-x-border-color;
104
+ }
105
+
106
+ .el-x-bubble-content-outlined {
107
+ background: none;
108
+ border: $--el-x-border-width solid $--el-x-border-color;
109
+ }
110
+
111
+ .el-x-bubble-content-shadow {
112
+ background: none;
113
+ // box-shadow: var(--el-box-shadow-tertiary);
114
+ box-shadow: $--el-x-box-shadow-base;
115
+ }
116
+
117
+ .el-x-bubble-content-loading {
118
+ width: fit-content;
119
+
120
+ .el-x-bubble-loading-wrap {
121
+ display: flex;
122
+ justify-content: center;
123
+ align-items: center;
124
+ // height: 16px;
125
+ /* 盒子高度 */
126
+ gap: 5px;
127
+ }
128
+
129
+ .dot {
130
+ width: 5px;
131
+ height: 5px;
132
+ background-color: $--color-primary;
133
+ /* 点的颜色 */
134
+ border-radius: 50%;
135
+ /* 圆形 */
136
+ animation: wave 1s infinite ease-in-out;
137
+ /* 动画 */
138
+ }
139
+
140
+ /* 波浪动画 */
141
+ @keyframes wave {
142
+ 0%,
143
+ 100% {
144
+ transform: translateY(-2px);
145
+ }
146
+
147
+ 50% {
148
+ transform: translateY(2px);
149
+ /* 上下波动 */
150
+ }
151
+ }
152
+ }
153
+
154
+ .el-x-bubble-footer {
155
+ margin-top: $--el-x-padding-sm;
156
+ }
157
+ }
@@ -46,7 +46,7 @@
46
46
  .el-x-conversations-load-more {
47
47
  display: flex;
48
48
  width: calc(100% - 20px);
49
- padding: 14px 10px;
49
+ padding: 4px 0;
50
50
  justify-content: center;
51
51
  align-items: center;
52
52
  font-size: 12px;