@blueking/chat-x 0.0.6 → 0.0.7

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.
@@ -47,7 +47,7 @@ ai-chat-container
47
47
  ├── 欢迎页(无消息时)
48
48
  │ ├── AIBluekingBannerIcon
49
49
  │ ├── 欢迎标题
50
- │ └── 开场白(ContentRender)
50
+ │ └── welcome 插槽(默认:开场白 ContentRender)
51
51
  ├── SelectionFooter(分享模式时)
52
52
  ├── ShortcutRender(有快捷指令时)
53
53
  └── ChatInput(默认状态)
@@ -200,6 +200,35 @@ ai-chat-container
200
200
  </template>
201
201
  ```
202
202
 
203
+ ### 自定义欢迎内容
204
+
205
+ 通过 `welcome` 插槽可完全自定义欢迎页内容,插槽参数 `openingRemark` 为传入的开场白文本:
206
+
207
+ ```vue
208
+ <template>
209
+ <ChatContainer
210
+ v-model="inputValue"
211
+ :messages="[]"
212
+ :message-status="messageStatus"
213
+ opening-remark="欢迎使用 AI 助手"
214
+ :on-send-message="handleSendMessage"
215
+ >
216
+ <template #welcome="{ openingRemark }">
217
+ <div class="my-welcome">
218
+ <h3>{{ openingRemark }}</h3>
219
+ <div class="quick-actions">
220
+ <button @click="handleQuickAction('code')">写代码</button>
221
+ <button @click="handleQuickAction('debug')">调试</button>
222
+ <button @click="handleQuickAction('explain')">解释</button>
223
+ </div>
224
+ </div>
225
+ </template>
226
+ </ChatContainer>
227
+ </template>
228
+ ```
229
+
230
+ > **注意**:使用 `welcome` 插槽后,默认的 `openingRemark` 渲染(`ContentRender`)将被替换,需要自行处理开场白展示逻辑。
231
+
203
232
  **渲染效果**
204
233
 
205
234
  ## 加载状态
@@ -327,6 +356,14 @@ ChatContainer 的 Props 继承自 `ChatInputProps` 和 `MessageContainerProps`
327
356
  | selectShortcut | `(shortcut: Shortcut)` | 选择快捷指令(继承自 ChatInput) |
328
357
  | deleteShortcut | `(shortcut: Shortcut)` | 删除已选快捷指令(继承自 ChatInput) |
329
358
 
359
+ ### Slots
360
+
361
+ | 插槽名 | 参数 | 说明 |
362
+ | ------- | --------------------------------- | ------------------------------------------------------------- |
363
+ | default | 消息列表相关绑定(messages 等) | 自定义消息列表区域 |
364
+ | message | `{ message, messageToolsStatus }` | 自定义单条消息渲染 |
365
+ | welcome | `{ openingRemark: string }` | 自定义欢迎页内容,替换默认的 openingRemark 渲染,无消息时显示 |
366
+
330
367
  ### Expose
331
368
 
332
369
  | 方法/属性名 | 类型 | 说明 |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-03-26T08:54:06.924Z",
3
+ "generatedAt": "2026-03-26T12:19:37.302Z",
4
4
  "domains": {
5
5
  "message": {
6
6
  "label": "消息展示",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {