@blueking/ai-blueking 0.5.2 → 0.5.3-beta.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.
- package/README.md +56 -0
- package/dist/ai-blueking-new.vue.d.ts +2 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/vue2/index.es.min.js +2321 -2315
- package/dist/vue2/index.iife.min.js +52 -52
- package/dist/vue2/index.umd.min.js +33 -33
- package/dist/vue2/style.css +1 -1
- package/dist/vue3/index.es.min.js +1045 -1039
- package/dist/vue3/index.iife.min.js +33 -33
- package/dist/vue3/index.umd.min.js +11 -11
- package/dist/vue3/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,6 +115,7 @@ export default {
|
|
|
115
115
|
| prompts | Array | [] | 预设提示词列表 |
|
|
116
116
|
| requestOptions | Object | {} | 自定义请求选项,可设置headers和data属性,分别合并到请求头和请求体 |
|
|
117
117
|
| defaultMinimize | Boolean | false | 控制 Nimbus 组件初始是否处于最小化状态 |
|
|
118
|
+
| teleportTo | String | 'body' | 指定将 AI 小鲸组件传送到的 DOM 节点,默认为 body 元素 |
|
|
118
119
|
| sessionContents | Array | [] | 暴露当前会话内容,可用于外部访问和操作 |
|
|
119
120
|
|
|
120
121
|
### shortcuts 格式示例
|
|
@@ -322,6 +323,30 @@ const apiUrl = 'https://your-api-endpoint.com/assistant/';
|
|
|
322
323
|
</script>
|
|
323
324
|
```
|
|
324
325
|
|
|
326
|
+
### Vue 3 自定义传送目标元素
|
|
327
|
+
|
|
328
|
+
```vue
|
|
329
|
+
<template>
|
|
330
|
+
<div>
|
|
331
|
+
<div id="ai-container"></div>
|
|
332
|
+
<AIBlueking
|
|
333
|
+
ref="aiBlueking"
|
|
334
|
+
:url="apiUrl"
|
|
335
|
+
teleport-to="#ai-container"
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
</template>
|
|
339
|
+
|
|
340
|
+
<script lang="ts" setup>
|
|
341
|
+
import { ref } from 'vue';
|
|
342
|
+
import AIBlueking from '@blueking/ai-blueking';
|
|
343
|
+
import '@blueking/ai-blueking/dist/vue3/style.css';
|
|
344
|
+
|
|
345
|
+
const aiBlueking = ref(null);
|
|
346
|
+
const apiUrl = 'https://your-api-endpoint.com/assistant/';
|
|
347
|
+
</script>
|
|
348
|
+
```
|
|
349
|
+
|
|
325
350
|
### Vue 3 自定义请求选项
|
|
326
351
|
|
|
327
352
|
```vue
|
|
@@ -484,6 +509,37 @@ export default {
|
|
|
484
509
|
</script>
|
|
485
510
|
```
|
|
486
511
|
|
|
512
|
+
### Vue 2 自定义传送目标元素
|
|
513
|
+
|
|
514
|
+
```vue
|
|
515
|
+
<template>
|
|
516
|
+
<div>
|
|
517
|
+
<div id="ai-container"></div>
|
|
518
|
+
<AIBlueking
|
|
519
|
+
ref="aiBlueking"
|
|
520
|
+
:url="apiUrl"
|
|
521
|
+
teleport-to="#ai-container"
|
|
522
|
+
/>
|
|
523
|
+
</div>
|
|
524
|
+
</template>
|
|
525
|
+
|
|
526
|
+
<script>
|
|
527
|
+
import AIBlueking from '@blueking/ai-blueking/vue2';
|
|
528
|
+
import '@blueking/ai-blueking/dist/vue2/style.css';
|
|
529
|
+
|
|
530
|
+
export default {
|
|
531
|
+
components: {
|
|
532
|
+
AIBlueking
|
|
533
|
+
},
|
|
534
|
+
data() {
|
|
535
|
+
return {
|
|
536
|
+
apiUrl: 'https://your-api-endpoint.com/assistant/'
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
</script>
|
|
541
|
+
```
|
|
542
|
+
|
|
487
543
|
## 框架差异注意事项
|
|
488
544
|
|
|
489
545
|
### Vue 2 与 Vue 3 的区别
|
|
@@ -8,6 +8,7 @@ interface Props {
|
|
|
8
8
|
prompts?: string[];
|
|
9
9
|
requestOptions?: IRequestOptions;
|
|
10
10
|
defaultMinimize?: boolean;
|
|
11
|
+
teleportTo?: string;
|
|
11
12
|
}
|
|
12
13
|
declare const _default: import("vue").DefineComponent<Props, {
|
|
13
14
|
sessionContents: import("vue").Ref<{
|
|
@@ -69,5 +70,6 @@ declare const _default: import("vue").DefineComponent<Props, {
|
|
|
69
70
|
url: string;
|
|
70
71
|
requestOptions: IRequestOptions;
|
|
71
72
|
defaultMinimize: boolean;
|
|
73
|
+
teleportTo: string;
|
|
72
74
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
73
75
|
export default _default;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -41,3 +41,9 @@ export declare function durationFormatter(val: number): string;
|
|
|
41
41
|
* @param el 需要滚动的元素
|
|
42
42
|
*/
|
|
43
43
|
export declare const scrollToBottom: (el: HTMLElement) => void;
|
|
44
|
+
/**
|
|
45
|
+
* 转义HTML
|
|
46
|
+
* @param str
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare const escapeHtml: (str: string) => string;
|