xiaoao-chat 0.4.0 → 0.4.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/README.md CHANGED
@@ -14,25 +14,6 @@ pnpm add xiaoao-chat
14
14
 
15
15
  ## Usage
16
16
 
17
- ### Basic Usage
18
-
19
- ```javascript
20
- import { createApp } from 'vue'
21
- import App from './App.vue'
22
-
23
- // Import the component library
24
- import { ChatPopup, FloatBall } from 'xiaoao-chat'
25
- import 'xiaoao-chat/style.css'
26
-
27
- const app = createApp(App)
28
-
29
- // Register components globally
30
- app.component('ChatPopup', ChatPopup)
31
- app.component('FloatBall', FloatBall)
32
-
33
- app.mount('#app')
34
- ```
35
-
36
17
  ### Component List
37
18
 
38
19
  - `ChatInput` - Chat input component
@@ -46,22 +27,44 @@ app.mount('#app')
46
27
  ```vue
47
28
  <template>
48
29
  <div>
49
- <FloatBall @click="showChat = true" />
50
- <ChatPopup v-if="showChat" @close="showChat = false" />
30
+ <!--
31
+ new-chat:是否显示新对话按钮 默认:false
32
+ contact-us:是否显示联系我们按钮 默认:false
33
+ is-download:是否显示下载导出 默认:true
34
+ -->
35
+ <FloatBall ref="FloatBallRef" :new-chat="true" :contact-us="true" :is-download="true" />
51
36
  </div>
52
37
  </template>
53
38
 
54
39
  <script setup>
55
40
  import { ref } from 'vue'
56
- import { ChatPopup, FloatBall } from 'xiaoao-chat'
57
41
 
58
- const showChat = ref(false)
42
+ import { FloatBall } from 'xiaoao-chat'
43
+ import 'xiaoao-chat/style.css'
44
+
45
+ const FloatBallRef = ref()
46
+
47
+ const open = () => {
48
+ /**
49
+ * open 参数可选:'revenue'、'factory'、'pipeline'、'website',不传默认为:factory
50
+ * revenue:营收智能体
51
+ * factory:厂站智能体
52
+ * pipeline:管网GIS智能体
53
+ * website:官网智能体
54
+ */
55
+ FloatBallRef.value.open('factory')
56
+ }
57
+
58
+ const close = () => {
59
+ FloatBallRef.value.close()
60
+ }
59
61
  </script>
60
62
  ```
61
63
 
62
64
  ## Dependencies
63
65
 
64
66
  This library depends on:
67
+
65
68
  - Vue 3 (^3.5.29)
66
69
  - Element Plus (^2.13.3)
67
70
  - Other dependencies are included in the package
@@ -91,6 +94,7 @@ pnpm build
91
94
  ```
92
95
 
93
96
  This will generate the following files in the `dist` directory:
97
+
94
98
  - `xiaoao-chat.js` - ES module bundle
95
99
  - `xiaoao-chat.umd.cjs` - UMD bundle
96
100
  - `style.css` - Compiled styles