@codernote/record-tree 1.1.1 → 1.2.0

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.
Files changed (3) hide show
  1. package/README.md +35 -12
  2. package/dist/index.js +12319 -572
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ### 安装
6
6
 
7
7
  ```bash
8
- npm install @codernote/record-tree
8
+ npm install --save @codernote/record-tree
9
9
  ```
10
10
 
11
11
  ### 使用
@@ -19,6 +19,37 @@ import { RecordTree } from "@codernote/record-tree";
19
19
  ></RecordTree>
20
20
  ```
21
21
 
22
+ ### 数据结构
23
+
24
+ note.content
25
+
26
+ ```ts
27
+ interface Nodes Array<{
28
+ // 节点唯一标识
29
+ uuid: string;
30
+
31
+ // 节点类型,纯文本节点type不设
32
+ type?: "image" | "video" | "audio" | "file";
33
+
34
+ // 节点文本
35
+ // 当普通文本节点时(无type), 取text进行渲染
36
+ text?: string;
37
+
38
+ // 有type时,content标识相关类型数据
39
+ // 存储远程资源url, 如https://xxx/xxx/xx.png
40
+ content?: string;
41
+
42
+ // type=file时,存储文件大小,单位byte
43
+ size?: number;
44
+
45
+ // type=file时,存储文件名
46
+ name?: string;
47
+
48
+ // 子节点
49
+ children?: Nodes;
50
+ }>;
51
+ ```
52
+
22
53
  ### props
23
54
 
24
55
  ```js
@@ -29,17 +60,12 @@ import { RecordTree } from "@codernote/record-tree";
29
60
  {/* 是否只读模式,默认false */}
30
61
  :readOnly="false"
31
62
 
32
- {/* 是否展示标签及切换标签功能, 默认true */}
33
- :tagVisible="true"
34
-
35
63
  {/* 标签列表 */}
64
+ {/* 不传则不展示标签 */}
36
65
  :tags="tags"
37
66
 
38
- {/* 是否移动端使用,默认false */}
39
- :isMobile="false"
40
-
41
- {/* 是否展示完成按钮,isMobile生效时才启用,默认false */}
42
- :showComplete="false"
67
+ {/* 底层操作栏类型,默认不显示操作栏, false */}
68
+ :bar="false"
43
69
 
44
70
  {/* 启用双击enter, 标题双击回车,会触发事件, 默认false */}
45
71
  :enableDbEnter="false"
@@ -49,9 +75,6 @@ import { RecordTree } from "@codernote/record-tree";
49
75
 
50
76
  {/* enableDbEnter=true时生效,标题双击回车时触发事件 */}
51
77
  @dbEnter="handleDbEnter"
52
-
53
- {/* showComplete=true 时生效,点击完成按钮触发事件 */}
54
- @complete="handleComplete"
55
78
  ></RecordTree>
56
79
  ```
57
80