From f2fbde376390404f43f2234d54af20b88c63eda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Mon, 18 Dec 2023 09:12:15 +0800 Subject: [PATCH] Doc: update --- web/src/pages/Doc/catalogList.js | 1 + web/src/pages/Doc/en/render/index.md | 26 +++++++++++++---- web/src/pages/Doc/en/render/index.vue | 19 +++++++++++-- web/src/pages/Doc/en/textEdit/index.md | 23 +++++++++++++++ web/src/pages/Doc/en/textEdit/index.vue | 29 +++++++++++++++++++ web/src/pages/Doc/routerList.js | 2 ++ web/src/pages/Doc/zh/render/index.md | 38 ++++++++++++++++++------- web/src/pages/Doc/zh/render/index.vue | 30 +++++++++++++------ web/src/pages/Doc/zh/textEdit/index.md | 23 +++++++++++++++ web/src/pages/Doc/zh/textEdit/index.vue | 29 +++++++++++++++++++ 10 files changed, 192 insertions(+), 28 deletions(-) create mode 100644 web/src/pages/Doc/en/textEdit/index.md create mode 100644 web/src/pages/Doc/en/textEdit/index.vue create mode 100644 web/src/pages/Doc/zh/textEdit/index.md create mode 100644 web/src/pages/Doc/zh/textEdit/index.vue diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index 3be383c5..2e802f4d 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -18,6 +18,7 @@ let APIList = [ 'constructor', 'node', 'render', + 'textEdit', 'view', 'keyCommand', 'command', diff --git a/web/src/pages/Doc/en/render/index.md b/web/src/pages/Doc/en/render/index.md index 9557d74d..7685b5a2 100644 --- a/web/src/pages/Doc/en/render/index.md +++ b/web/src/pages/Doc/en/render/index.md @@ -11,7 +11,13 @@ Gets the current list of active nodes. ### root -Gets the root node of the node tree. +Node tree, also known as the mind map node instance tree. + +### renderTree + +The rendering tree, also known as the data tree of the mind map. + +### layout ## Methods @@ -114,10 +120,6 @@ Search for the index of a node in the active list. Get the position index of a node among its siblings. -### removeOneNode(node) - -Delete a specific node. - ### copyNode() Copy a node, the active node is the node to be operated on, if there are @@ -191,4 +193,16 @@ Cut a node. After calling this method, the currently active node will be cut and > v0.6.8+ -Pasting nodes can be done by calling the 'copy()' or 'cut()' method after calling it. This method does not support pasting data from the user's clipboard. Please use the built-in 'Ctrl+v' shortcut key. \ No newline at end of file +Pasting nodes can be done by calling the 'copy()' or 'cut()' method after calling it. This method does not support pasting data from the user's clipboard. Please use the built-in 'Ctrl+v' shortcut key. + +### clearCache() + +Empty the node cache pool. + +### emitNodeActiveEvent(node = null, activeNodeList = [...this.activeNodeList]) + +- `node`:The node activated this time + +- `activeNodeList`:All currently activated nodes + +Dispatch node activation event, which triggers `node_active` event. \ No newline at end of file diff --git a/web/src/pages/Doc/en/render/index.vue b/web/src/pages/Doc/en/render/index.vue index 2eedcb2c..22fd750e 100644 --- a/web/src/pages/Doc/en/render/index.vue +++ b/web/src/pages/Doc/en/render/index.vue @@ -7,7 +7,10 @@ accessed through mindMap.renderer.

activeNodeList

Gets the current list of active nodes.

root

-

Gets the root node of the node tree.

+

Node tree, also known as the mind map node instance tree.

+

renderTree

+

The rendering tree, also known as the data tree of the mind map.

+

layout

Methods

highlightNode(node, range)

@@ -93,8 +96,6 @@ disable the enter key and delete key related shortcuts to prevent conflicts.

Search for the index of a node in the active list.

getNodeIndex(node)

Get the position index of a node among its siblings.

-

removeOneNode(node)

-

Delete a specific node.

copyNode()

Copy a node, the active node is the node to be operated on, if there are multiple active nodes, only the first node will be operated on.

@@ -162,6 +163,18 @@ is an object, e.g. {text: 'I am new text'}.

v0.6.8+

Pasting nodes can be done by calling the 'copy()' or 'cut()' method after calling it. This method does not support pasting data from the user's clipboard. Please use the built-in 'Ctrl+v' shortcut key.

+

clearCache()

+

Empty the node cache pool.

+

emitNodeActiveEvent(node = null, activeNodeList = [...this.activeNodeList])

+ +

Dispatch node activation event, which triggers node_active event.

diff --git a/web/src/pages/Doc/en/textEdit/index.md b/web/src/pages/Doc/en/textEdit/index.md new file mode 100644 index 00000000..57fc2299 --- /dev/null +++ b/web/src/pages/Doc/en/textEdit/index.md @@ -0,0 +1,23 @@ +# TextEdit instance + +Node text editing instance. It can be obtained through `mindMap.renderer.textEdit`. + +## Methods + +### isShowTextEdit() + +Get whether the current text editing box is in a display state, that is, whether it is in a text editing state. + +### hideEditTextBox() + +Hiding the text editing box will set the content of the current text editing box as node text. + +### registerTmpShortcut() + +Register temporary shortcut keys, which means editing can be completed through the Enter and Tab keys. + +### show({ node}) + +- `node`:Node instance to enter for editing + +Manually enable node editing. By default, it will enter node editing when double clicking or pressing F2 on the node. diff --git a/web/src/pages/Doc/en/textEdit/index.vue b/web/src/pages/Doc/en/textEdit/index.vue new file mode 100644 index 00000000..06b8280f --- /dev/null +++ b/web/src/pages/Doc/en/textEdit/index.vue @@ -0,0 +1,29 @@ + + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js index 4d79cbe0..0eab580b 100644 --- a/web/src/pages/Doc/routerList.js +++ b/web/src/pages/Doc/routerList.js @@ -41,6 +41,7 @@ export default [ { path: 'miniMap', title: 'MiniMap插件' }, { path: 'node', title: 'Node实例' }, { path: 'render', title: 'Render实例' }, + { path: 'textEdit', title: 'TextEdit实例' }, { path: 'richText', title: 'RichText插件' }, { path: 'select', title: 'Select 插件 ' }, { path: 'start', title: '开始' }, @@ -83,6 +84,7 @@ export default [ { path: 'miniMap', title: 'MiniMap plugin' }, { path: 'node', title: 'Node instance' }, { path: 'render', title: 'Render instance' }, + { path: 'textEdit', title: 'TextEdit instance' }, { path: 'richText', title: 'RichText plugin' }, { path: 'select', title: 'Select plugin' }, { path: 'start', title: 'Start' }, diff --git a/web/src/pages/Doc/zh/render/index.md b/web/src/pages/Doc/zh/render/index.md index e370e402..5478f4a9 100644 --- a/web/src/pages/Doc/zh/render/index.md +++ b/web/src/pages/Doc/zh/render/index.md @@ -1,4 +1,4 @@ -# Render实例 +# Render 实例 `render`实例负载整个渲染过程,可通过`mindMap.renderer`获取到。 @@ -10,7 +10,15 @@ ### root -获取节点树的根节点。 +节点树,也就是思维导图节点实例树。 + +### renderTree + +渲染树,也就是思维导图的数据树。 + +### layout + +当前的布局实例。 ## 方法 @@ -112,10 +120,6 @@ 获取节点在同级里的位置索引。 -### removeOneNode(node) - -删除某个指定节点。 - ### copyNode() 复制节点,操作节点为当前激活节点,有多个激活节点只会操作第一个节点。 @@ -156,19 +160,19 @@ > v0.6.7+ -- `uid`:节点uid +- `uid`:节点 uid - `callback`:展开完成的回调函数 -展开到指定uid的节点。 +展开到指定 uid 的节点。 ### findNodeByUid(uid) > v0.6.7+ -- `uid`:节点uid +- `uid`:节点 uid -根据uid找到对应的节点实例。 +根据 uid 找到对应的节点实例。 ### copy() @@ -186,4 +190,16 @@ > v0.6.8+ -粘贴节点,在调用了`copy()`或`cut()`方法后可以调用该方法进行粘贴节点。该方法不支持粘贴用户剪贴板中的数据,请使用内置的`Ctrl+v`快捷键。 \ No newline at end of file +粘贴节点,在调用了`copy()`或`cut()`方法后可以调用该方法进行粘贴节点。该方法不支持粘贴用户剪贴板中的数据,请使用内置的`Ctrl+v`快捷键。 + +### clearCache() + +清空节点缓存池。 + +### emitNodeActiveEvent(node = null, activeNodeList = [...this.activeNodeList]) + +- `node`:本次激活的节点 + +- `activeNodeList`:当前所有激活的节点 + +派发节点激活事件,也就是触发`node_active`事件。 diff --git a/web/src/pages/Doc/zh/render/index.vue b/web/src/pages/Doc/zh/render/index.vue index ea0a4439..e25dedad 100644 --- a/web/src/pages/Doc/zh/render/index.vue +++ b/web/src/pages/Doc/zh/render/index.vue @@ -1,12 +1,16 @@ diff --git a/web/src/pages/Doc/zh/textEdit/index.md b/web/src/pages/Doc/zh/textEdit/index.md new file mode 100644 index 00000000..cd97647d --- /dev/null +++ b/web/src/pages/Doc/zh/textEdit/index.md @@ -0,0 +1,23 @@ +# TextEdit 实例 + +节点文本编辑实例。可以通过`mindMap.renderer.textEdit`获取到。 + +## 方法 + +### isShowTextEdit() + +获取当前文本编辑框是否处于显示状态,也就是是否处在文本编辑状态。 + +### hideEditTextBox() + +隐藏文本编辑框,会将当前文本编辑框中的内容设置为节点文本。 + +### registerTmpShortcut() + +注册临时快捷键,也就是可以通过 Enter 键和 Tab 键完成编辑。 + +### show({ node}) + +- `node`:要进入编辑的节点实例 + +手动开启节点编辑。默认会在节点双击、按 F2 时进入节点编辑。 diff --git a/web/src/pages/Doc/zh/textEdit/index.vue b/web/src/pages/Doc/zh/textEdit/index.vue new file mode 100644 index 00000000..693d2404 --- /dev/null +++ b/web/src/pages/Doc/zh/textEdit/index.vue @@ -0,0 +1,29 @@ + + + + + \ No newline at end of file