yl-ai-modal 1.0.0 → 1.0.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.

Potentially problematic release.


This version of yl-ai-modal might be problematic. Click here for more details.

package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  | 版本号 | 变更内容 |
4
4
  | - | - |
5
+ | 1.0.2 | 添加destroy方法,open方法 |
6
+ | 1.0.1 | 细节调整,使用方式调整,引入方式调整,请优先使用新版本 |
5
7
  | 1.0.0 | 初始化 |
6
8
 
7
9
  ### yl-ai-modal (使用vue3封装的组件)
@@ -9,14 +11,32 @@
9
11
  #### 使用方法
10
12
  在组件或jsx的script中:
11
13
  ```
12
- import 'yl-ai-modal/yl-ai-modal.css'
14
+ //引入组件
15
+ import 'yl-ai-modal/dist/yl-ai-modal.css'
13
16
  import ylAiModal from 'yl-ai-modal'
14
17
 
15
- const show = () => {
16
- ylAiModal({
17
- url: 'https://www.antdv.com/docs/vue/introduce-cn/'
18
- })
19
- }
20
-
21
- show()
18
+ let aiModalHandle = null;
19
+ // 初始化或销毁
20
+ const init = () => {
21
+ if (aiModalHandle) {
22
+ aiModalHandle.destroy();
23
+ aiModalHandle = null;
24
+ } else {
25
+ aiModalHandle = ylAiModal({
26
+ // url: 'https://www.antdv.com/docs/vue/introduce-cn/',
27
+ });
28
+ }
29
+ };
30
+ // 打开对话框
31
+ const open = () => {
32
+ if (aiModalHandle) {
33
+ aiModalHandle.open();
34
+ }
35
+ };
36
+ // 隐藏对话框
37
+ const close = () => {
38
+ if (aiModalHandle) {
39
+ aiModalHandle.close();
40
+ }
41
+ };
22
42
  ```