diff --git a/simple-mind-map/package.json b/simple-mind-map/package.json
index 43711733..8d67de78 100644
--- a/simple-mind-map/package.json
+++ b/simple-mind-map/package.json
@@ -1,6 +1,6 @@
{
"name": "simple-mind-map",
- "version": "0.9.2",
+ "version": "0.9.3",
"description": "一个简单的web在线思维导图",
"authors": [
{
diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md
index 4b30ad9d..404ccbba 100644
--- a/web/src/pages/Doc/en/changelog/index.md
+++ b/web/src/pages/Doc/en/changelog/index.md
@@ -1,5 +1,37 @@
# Changelog
+## 0.9.3
+
+Fix
+
+> 1.Fix the issue of text misalignment when nodes have icons in Safari browser.
+>
+> 2.Fix the issue of formula rendering in browsers with lower versions of Chrome kernel.
+>
+> 3.Fix the issue of new MouseEvent code execution errors when used in micro front-end framework applications.
+>
+> 4.Fix the issue of missing arrows on node connections, arrows on associated lines, and gradient backgrounds when exporting images.
+
+New:
+
+> 1.Export PDF from jspdf library to pdf-lib library.
+>
+> 2.If the second parameter of the set node text command (SETNODE-TEXT) is not passed, the previous value will be used.
+>
+> 3.There is an issue of incorrect width and height of exported images in Firefox browser when optimizing nodes with hyperlinks and comments.
+>
+> 4.In node text editing, if the pasted data is in SMM format, the pure text of the first node will be taken out for pasting.
+>
+> 5.Add interception operations for pasting when editing nodes without rich text.
+>
+> 6.Add a detailed event (data_change_detail) for updating node data, which can retrieve newly created, updated, or deleted node data.
+>
+> 7.Theme configuration supports setting node gradient background color.
+
+Demo:
+
+1.Support setting the background of node gradients.
+
## 0.9.2
Fix:
diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue
index 283e0196..70ce0db8 100644
--- a/web/src/pages/Doc/en/changelog/index.vue
+++ b/web/src/pages/Doc/en/changelog/index.vue
@@ -1,6 +1,26 @@
Fix 1.Fix the issue of text misalignment when nodes have icons in Safari browser. 2.Fix the issue of formula rendering in browsers with lower versions of Chrome kernel. 3.Fix the issue of new MouseEvent code execution errors when used in micro front-end framework applications. 4.Fix the issue of missing arrows on node connections, arrows on associated lines, and gradient backgrounds when exporting images. New: 1.Export PDF from jspdf library to pdf-lib library. 2.If the second parameter of the set node text command (SETNODE-TEXT) is not passed, the previous value will be used. 3.There is an issue of incorrect width and height of exported images in Firefox browser when optimizing nodes with hyperlinks and comments. 4.In node text editing, if the pasted data is in SMM format, the pure text of the first node will be taken out for pasting. 5.Add interception operations for pasting when editing nodes without rich text. 6.Add a detailed event (data_change_detail) for updating node data, which can retrieve newly created, updated, or deleted node data. 7.Theme configuration supports setting node gradient background color. Demo: 1.Support setting the background of node gradients. Fix: Export as In versions before v0.9.3, this method does not return data and will directly trigger the download. After v0.6.0, an additional ExportPDF plugin needs to be registered The internal export of PDF uses the PDF lib library to convert images into PDF. Currently, when exporting PDF with a large number of nodes, some content may be lost. Therefore, it is recommended that capable developers implement the PDF export function themselves. If there are backend developers in the project, they can also seek support from backend developers. This formula may not render successfully on a few browsers. If you need to be compatible with these browsers, you can consider changing the configuration to 'HTML'. For detailed documentation, please refer to Options. Using this configuration may require the introduction of a 'KaTeX' style file, which you can test on your own. v0.9.3+will internally determine whether the current Chrome kernel version of the browser is lower than 100, If so, it will automatically convert 'output' from 'mathml' to 'html', At this point, the style file for 'KaTeX' needs to be imported, but it is not imported within the library, so you need to manually import it in the project. If you introduced 'simple-mind-map' through the 'npm' method, you can introduce it as follows: If you are using packaged files such as '.umd.js' or '.esm.js', you can import them through online CDN services, such as Pass in the specified node instance through the second parameter. Get the current configuration passed to Changelog
+0.9.3
+
+
+
+
+0.9.2
diff --git a/web/src/pages/Doc/en/constructor/index.md b/web/src/pages/Doc/en/constructor/index.md
index 6ff4d060..ebfe56bd 100644
--- a/web/src/pages/Doc/en/constructor/index.md
+++ b/web/src/pages/Doc/en/constructor/index.md
@@ -420,6 +420,7 @@ Listen to an event. Event list:
| beforeDestroy(v0.9.0+) | Triggered before destroying the mind map, i.e. triggered by calling the destroy method | |
| body_mousedown(v0.9.2+) | Mousedown event of document.body | e(event object) |
| body_click | Click event of document.body | e(event object) |
+| data_change_detail(v0.9.3+) | The detailed changes in rendering tree data will return an array, with each item representing an update point and each item being an object, There is a 'type' attribute that represents the type of detail, Including 'create' (create node), 'update' (update node), 'delete' (delete node), There is a 'data' attribute that represents the current updated node data. If it is of the 'update' type, there will also be an 'oldData' attribute that saves the data of the node before the update | arr(Detail data) |
### emit(event, ...args)
diff --git a/web/src/pages/Doc/en/constructor/index.vue b/web/src/pages/Doc/en/constructor/index.vue
index e7719bc5..81ddc71f 100644
--- a/web/src/pages/Doc/en/constructor/index.vue
+++ b/web/src/pages/Doc/en/constructor/index.vue
@@ -1109,6 +1109,11 @@ poor performance and should be used sparingly.
Click event of document.body
e(event object)
+
+
data_change_detail(v0.9.3+)
+The detailed changes in rendering tree data will return an array, with each item representing an update point and each item being an object, There is a 'type' attribute that represents the type of detail, Including 'create' (create node), 'update' (update node), 'delete' (delete node), There is a 'data' attribute that represents the current updated node data. If it is of the 'update' type, there will also be an 'oldData' attribute that saves the data of the node before the update
+arr(Detail data)
+emit(event, ...args)
diff --git a/web/src/pages/Doc/en/doExport/index.md b/web/src/pages/Doc/en/doExport/index.md
index b4fdacf9..6853c68c 100644
--- a/web/src/pages/Doc/en/doExport/index.md
+++ b/web/src/pages/Doc/en/doExport/index.md
@@ -90,8 +90,12 @@ Exports as `svg`.
Export as `pdf`. Unlike other export methods, this method does not return data and directly triggers the download.
+> In versions before v0.9.3, this method does not return data and will directly trigger the download.
+
> After v0.6.0, an additional ExportPDF plugin needs to be registered
+> The internal export of PDF uses the PDF lib library to convert images into PDF. Currently, when exporting PDF with a large number of nodes, some content may be lost. Therefore, it is recommended that capable developers implement the PDF export function themselves. If there are backend developers in the project, they can also seek support from backend developers.
+
```js
import ExportPDF from 'simple-mind-map/src/plugins/ExportPDF.js'
MindMap.usePlugin(ExportPDF)
diff --git a/web/src/pages/Doc/en/doExport/index.vue b/web/src/pages/Doc/en/doExport/index.vue
index dea8489a..ded75a29 100644
--- a/web/src/pages/Doc/en/doExport/index.vue
+++ b/web/src/pages/Doc/en/doExport/index.vue
@@ -92,8 +92,14 @@ a.click()
pdf. Unlike other export methods, this method does not return data and directly triggers the download.
+
+
+
+
diff --git a/web/src/pages/Doc/en/formula/index.md b/web/src/pages/Doc/en/formula/index.md
index a616778b..2ac26329 100644
--- a/web/src/pages/Doc/en/formula/index.md
+++ b/web/src/pages/Doc/en/formula/index.md
@@ -18,6 +18,13 @@ This plugin is used to support inserting formulas into nodes.
> This formula may not render successfully on a few browsers. If you need to be compatible with these browsers, you can consider changing the configuration to 'HTML'. For detailed documentation, please refer to [Options](https://katex.org/docs/options). Using this configuration may require the introduction of a 'KaTeX' style file, which you can test on your own.
+> v0.9.3+will internally determine whether the current Chrome kernel version of the browser is lower than 100, If so, it will automatically convert 'output' from 'mathml' to 'html', At this point, the style file for 'KaTeX' needs to be imported, but it is not imported within the library, so you need to manually import it in the project. If you introduced 'simple-mind-map' through the 'npm' method, you can introduce it as follows:
+>
+> ```js
+> import 'simple-mind-map/node_modules/katex/dist/katex.min.css'
+> ```
+> If you are using packaged files such as '.umd.js' or '.esm.js', you can import them through online CDN services, such as `https://unpkg.com/browse/katex@0.16.9/dist/`, Of course, it is best to upload the 'css' file of the 'katex' and the corresponding font files in the 'fonts' directory to your own server.
+
## Register
```js
@@ -45,4 +52,10 @@ If you want to assign a formula to a node or nodes, you can pass the second para
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
```
-Pass in the specified node instance through the second parameter.
\ No newline at end of file
+Pass in the specified node instance through the second parameter.
+
+## Methods
+
+### getKatexConfig()
+
+Get the current configuration passed to `Katex`.
\ No newline at end of file
diff --git a/web/src/pages/Doc/en/formula/index.vue b/web/src/pages/Doc/en/formula/index.vue
index 2ee7ca70..cf2ba564 100644
--- a/web/src/pages/Doc/en/formula/index.vue
+++ b/web/src/pages/Doc/en/formula/index.vue
@@ -21,6 +21,12 @@
import ExportPDF from 'simple-mind-map/src/plugins/ExportPDF.js'
MindMap.usePlugin(ExportPDF)
+
+
+import 'simple-mind-map/node_modules/katex/dist/katex.min.css'
+https://unpkg.com/browse/katex@0.16.9/dist/, Of course, it is best to upload the 'css' file of the 'katex' and the corresponding font files in the 'fonts' directory to your own server.Register
import MindMap from 'simple-mind-map'
import Formula from 'simple-mind-map/src/plugins/Formula.js'
@@ -37,6 +43,9 @@ MindMap.usePlugin(Formula)
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
Methods
+getKatexConfig()
+Katex.key is not passed, return the data object
Set the value of the specified key in the data object of the node's real data
nodeData, SET_NODE_DATA command's shortcut method. This method and command will not update the view, so if you want to modify the text, use the 'setText' method or use the command pointing to the text.
richText: v0.4.2+,Boolean, If you want to set rich text content, that is, html character, richText needs to be passed true
richText: v0.4.2+,Boolean, If you want to set rich text content, that is, html character, richText needs to be passed true. After version 0.9.3+, if this parameter is not passed, it will use previous value.
resetRichText: v0.6.10+, Boolean, whether to reset rich text, The default is 'false'. If 'true' is passed, the style of the rich text node will be reset
data of the data object, example:
list1/list2: Node instance listCheck if the two node instance lists contain the same nodes.
+++v0.9.3+
+
Get the current version of the Chrome kernel used by the browser. If the current browser is not using the 'Chrome' kernel, an empty string will be returned.
+++v0.9.3+
+
data:Mind map node data.Convert the mind map tree structure to a level object.
+{
+ data: {
+ uid: 'xxx'
+ },
+ children: [
+ {
+ data: {
+ uid: 'xxx'
+ },
+ children: []
+ }
+ ]
+ }
+
+Convert to:
+ {
+ uid: {
+ children: [uid1, uid2],
+ data: {}
+ }
+ }
+
+++v0.9.3+
+
Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.
Import:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 60e636fb..65f7c395 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -1,5 +1,37 @@
# Changelog
+## 0.9.3
+
+修复:
+
+> 1.修复 Safari 浏览器上节点存在图标时文字位置错位的问题。
+>
+> 2.修复 Chrome 内核版本比较低的浏览器中公式无法渲染的问题。
+>
+> 3.修复在微前端框架子应用中使用时,new MouseEvent代码执行报错的问题。
+>
+> 4.修复导出图片时节点连线的箭头、关联线的箭头、渐变背景丢失的问题。
+
+新增:
+
+> 1.导出 pdf 从 jspdf 库改为 pdf-lib 库。
+>
+> 2.设置节点文本命令(SET_NODE_TEXT)的第二个参数如果没有传递,会使用之前的值。
+>
+> 3.优化节点存在超链接、备注时在 Firefox 浏览器中导出图片的宽高不正确的问题。
+>
+> 4.节点文本编辑中,如果粘贴的是 smm 格式的粘贴数据,那么会取出第一个节点的纯文本进行粘贴。
+>
+> 5.增加对节点非富文本编辑时的粘贴的拦截操作。
+>
+> 6.新增节点数据更新的明细事件(data_change_detail),可以获取新创建、更新、被删除的节点数据。
+>
+> 7.主题配置支持设置节点渐变背景色。
+
+Demo:
+
+1.支持设置节点渐变色的背景。
+
## 0.9.2
修复:
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index 95b279c9..bb0906f5 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -1,6 +1,26 @@
Changelog
+0.9.3
+修复:
+
+1.修复 Safari 浏览器上节点存在图标时文字位置错位的问题。
+2.修复 Chrome 内核版本比较低的浏览器中公式无法渲染的问题。
+3.修复在微前端框架子应用中使用时,new MouseEvent代码执行报错的问题。
+4.修复导出图片时节点连线的箭头、关联线的箭头、渐变背景丢失的问题。
+
+新增:
+
+1.导出 pdf 从 jspdf 库改为 pdf-lib 库。
+2.设置节点文本命令(SET_NODE_TEXT)的第二个参数如果没有传递,会使用之前的值。
+3.优化节点存在超链接、备注时在 Firefox 浏览器中导出图片的宽高不正确的问题。
+4.节点文本编辑中,如果粘贴的是 smm 格式的粘贴数据,那么会取出第一个节点的纯文本进行粘贴。
+5.增加对节点非富文本编辑时的粘贴的拦截操作。
+6.新增节点数据更新的明细事件(data_change_detail),可以获取新创建、更新、被删除的节点数据。
+7.主题配置支持设置节点渐变背景色。
+
+Demo:
+1.支持设置节点渐变色的背景。
0.9.2
修复:
diff --git a/web/src/pages/Doc/zh/constructor/index.md b/web/src/pages/Doc/zh/constructor/index.md
index c8c58fd8..6f779a5e 100644
--- a/web/src/pages/Doc/zh/constructor/index.md
+++ b/web/src/pages/Doc/zh/constructor/index.md
@@ -417,6 +417,7 @@ mindMap.setTheme('主题名称')
| beforeDestroy(v0.9.0+) | 思维导图销毁前触发,即调用了destroy方法触发 | |
| body_mousedown(v0.9.2+) | document.body的鼠标按下事件 | e(事件对象) |
| body_click | document.body的点击事件 | e(事件对象) |
+| data_change_detail(v0.9.3+) | 渲染树数据变化的明细,会返回一个数组,每一项代表一个更新点,每一项都是一个对象,存在一个`type`属性,代表明细的类型,包含`create`(创建节点)、`update`(更新节点)、`delete`(删除节点),存在一个`data`属性,代表当前更新的节点数据,如果是`update`类型,还会存在一个`oldData`属性,保存了更新前该节点的数据 | arr(明细数据) |
### emit(event, ...args)
diff --git a/web/src/pages/Doc/zh/constructor/index.vue b/web/src/pages/Doc/zh/constructor/index.vue
index 745e894f..ddf06dfd 100644
--- a/web/src/pages/Doc/zh/constructor/index.vue
+++ b/web/src/pages/Doc/zh/constructor/index.vue
@@ -1017,6 +1017,11 @@ mindMap.setTheme('主题名称')
document.body的点击事件
e(事件对象)
+
+data_change_detail(v0.9.3+)
+渲染树数据变化的明细,会返回一个数组,每一项代表一个更新点,每一项都是一个对象,存在一个type属性,代表明细的类型,包含create(创建节点)、update(更新节点)、delete(删除节点),存在一个data属性,代表当前更新的节点数据,如果是update类型,还会存在一个oldData属性,保存了更新前该节点的数据
+arr(明细数据)
+
emit(event, ...args)
diff --git a/web/src/pages/Doc/zh/doExport/index.md b/web/src/pages/Doc/zh/doExport/index.md
index 6ed31653..a8c10c03 100644
--- a/web/src/pages/Doc/zh/doExport/index.md
+++ b/web/src/pages/Doc/zh/doExport/index.md
@@ -94,6 +94,8 @@ svg(
> v0.6.0版本以后,需要额外注册一个ExportPDF插件
+> 内部导出pdf使用的是pdf-lib库将图片转为pdf,目前当节点数量比较大时导出pdf可能会丢失部分内容,所以建议有能力的开发者自行实现pdf的导出功能,如果项目中有后端开发,也可以寻求后端开发人员的支持。
+
```js
import ExportPDF from 'simple-mind-map/src/plugins/ExportPDF.js'
MindMap.usePlugin(ExportPDF)
diff --git a/web/src/pages/Doc/zh/doExport/index.vue b/web/src/pages/Doc/zh/doExport/index.vue
index ba87aa09..0c52f718 100644
--- a/web/src/pages/Doc/zh/doExport/index.vue
+++ b/web/src/pages/Doc/zh/doExport/index.vue
@@ -97,6 +97,9 @@ a.click()
v0.6.0版本以后,需要额外注册一个ExportPDF插件
+
+内部导出pdf使用的是pdf-lib库将图片转为pdf,目前当节点数量比较大时导出pdf可能会丢失部分内容,所以建议有能力的开发者自行实现pdf的导出功能,如果项目中有后端开发,也可以寻求后端开发人员的支持。
+
import ExportPDF from 'simple-mind-map/src/plugins/ExportPDF.js'
MindMap.usePlugin(ExportPDF)
diff --git a/web/src/pages/Doc/zh/formula/index.md b/web/src/pages/Doc/zh/formula/index.md
index 3f3cbaf4..ad6cb3f5 100644
--- a/web/src/pages/Doc/zh/formula/index.md
+++ b/web/src/pages/Doc/zh/formula/index.md
@@ -16,6 +16,14 @@
> 这在少数浏览器上公式可能无法成功渲染,如果你需要兼容这部分浏览器,你可以考虑把该配置改为`html`,详细文档可以参考:[Options](https://katex.org/docs/options)。使用这个配置可能还需要再引入`KaTeX`的样式文件,你可以自行测试。
+> v.0.9.3+版本内部会判断当前浏览器的Chrome内核版本是否低于100,是的话会自动将`output`由`mathml`转为`html`,此时需要引入`KaTeX`的样式文件,库内部没有引入,所以需要你手动在项目中引入。如果你是通过`npm`方式引入`simple-mind-map`,那么你可以这么引入:
+>
+> ```js
+> import 'simple-mind-map/node_modules/katex/dist/katex.min.css'
+> ```
+> 如果你使用的是`.umd.js`、`.esm.js`之类的打包后的文件,那么可以通过在线的CDN服务来引入,比如:`https://unpkg.com/browse/katex@0.16.9/dist/`,当然,最好是把`katex`的`css`文件,以及对应的`fonts`目录下的字体文件上传到你自己的服务器上。
+
+
## 注册
```js
@@ -43,4 +51,10 @@ mindMap.execCommand('INSERT_FORMULA', 'a^2')
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
```
-通过第二个参数传入指定的节点实例即可。
\ No newline at end of file
+通过第二个参数传入指定的节点实例即可。
+
+## 方法
+
+### getKatexConfig()
+
+获取当前传递给`Katex`的配置。
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/formula/index.vue b/web/src/pages/Doc/zh/formula/index.vue
index faa53fe9..539ebd34 100644
--- a/web/src/pages/Doc/zh/formula/index.vue
+++ b/web/src/pages/Doc/zh/formula/index.vue
@@ -18,6 +18,12 @@
这在少数浏览器上公式可能无法成功渲染,如果你需要兼容这部分浏览器,你可以考虑把该配置改为html,详细文档可以参考:Options。使用这个配置可能还需要再引入KaTeX的样式文件,你可以自行测试。
+
+v.0.9.3+版本内部会判断当前浏览器的Chrome内核版本是否低于100,是的话会自动将output由mathml转为html,此时需要引入KaTeX的样式文件,库内部没有引入,所以需要你手动在项目中引入。如果你是通过npm方式引入simple-mind-map,那么你可以这么引入:
+import 'simple-mind-map/node_modules/katex/dist/katex.min.css'
+
+如果你使用的是.umd.js、.esm.js之类的打包后的文件,那么可以通过在线的CDN服务来引入,比如:https://unpkg.com/browse/katex@0.16.9/dist/,当然,最好是把katex的css文件,以及对应的fonts目录下的字体文件上传到你自己的服务器上。
+
注册
import MindMap from 'simple-mind-map'
import Formula from 'simple-mind-map/src/plugins/Formula.js'
@@ -34,6 +40,9 @@ MindMap.usePlugin(Formula)
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
通过第二个参数传入指定的节点实例即可。
+方法
+getKatexConfig()
+获取当前传递给Katex的配置。
diff --git a/web/src/pages/Doc/zh/node/index.md b/web/src/pages/Doc/zh/node/index.md
index 70d0d579..657f087f 100644
--- a/web/src/pages/Doc/zh/node/index.md
+++ b/web/src/pages/Doc/zh/node/index.md
@@ -218,7 +218,7 @@
### setText(text, richText, resetRichText)
-- `richText`:v0.4.2+,`Boolean`,如果要设置的是富文本内容,也就是`html`字符,`richText`需要传`true`
+- `richText`:v0.4.2+,`Boolean`,如果要设置的是富文本内容,也就是`html`字符,`richText`需要传`true`。在v0.9.3+版本后该参数不传会默认使用之前的值。
- `resetRichText`:v0.6.10+,`Boolean`,是否要复位富文本,默认为`false`,如果传`true`那么会重置富文本节点的样式
diff --git a/web/src/pages/Doc/zh/node/index.vue b/web/src/pages/Doc/zh/node/index.vue
index 84fd2cdb..c0e15c42 100644
--- a/web/src/pages/Doc/zh/node/index.vue
+++ b/web/src/pages/Doc/zh/node/index.vue
@@ -158,7 +158,7 @@
setText(text, richText, resetRichText)
-
-
richText:v0.4.2+,Boolean,如果要设置的是富文本内容,也就是html字符,richText需要传true
+richText:v0.4.2+,Boolean,如果要设置的是富文本内容,也就是html字符,richText需要传true。在v0.9.3+版本后该参数不传会默认使用之前的值。
-
resetRichText:v0.6.10+,Boolean,是否要复位富文本,默认为false,如果传true那么会重置富文本节点的样式
diff --git a/web/src/pages/Doc/zh/utils/index.md b/web/src/pages/Doc/zh/utils/index.md
index 81d3c553..226bae22 100644
--- a/web/src/pages/Doc/zh/utils/index.md
+++ b/web/src/pages/Doc/zh/utils/index.md
@@ -419,6 +419,51 @@ copyNodeTree({}, node)
检查两个节点实例列表包含的节点是否是一样的。
+#### getChromeVersion()
+
+> v0.9.3+
+
+获取当前浏览器使用的`Chrome`内核版本。如果当前浏览器使用的不是 `Chrome`内核,那么会返回空字符串。
+
+#### transformTreeDataToObject(data)
+
+> v0.9.3+
+
+- `data`:思维导图节点数据。
+
+将思维导图树结构转平级对象。
+
+```js
+{
+ data: {
+ uid: 'xxx'
+ },
+ children: [
+ {
+ data: {
+ uid: 'xxx'
+ },
+ children: []
+ }
+ ]
+ }
+```
+转为:
+```js
+ {
+ uid: {
+ children: [uid1, uid2],
+ data: {}
+ }
+ }
+```
+
+#### transformObjectToTreeData(data)
+
+> v0.9.3+
+
+将平级对象转树结构。transformTreeDataToObject方法的反向操作。
+
## 在canvas中模拟css的背景属性
引入:
diff --git a/web/src/pages/Doc/zh/utils/index.vue b/web/src/pages/Doc/zh/utils/index.vue
index b8a58428..d14ca51e 100644
--- a/web/src/pages/Doc/zh/utils/index.vue
+++ b/web/src/pages/Doc/zh/utils/index.vue
@@ -344,6 +344,46 @@
list1/list2:节点实例列表
检查两个节点实例列表包含的节点是否是一样的。
+getChromeVersion()
+
+v0.9.3+
+
+获取当前浏览器使用的Chrome内核版本。如果当前浏览器使用的不是 Chrome内核,那么会返回空字符串。
+transformTreeDataToObject(data)
+
+v0.9.3+
+
+
+data:思维导图节点数据。
+
+将思维导图树结构转平级对象。
+{
+ data: {
+ uid: 'xxx'
+ },
+ children: [
+ {
+ data: {
+ uid: 'xxx'
+ },
+ children: []
+ }
+ ]
+ }
+
+转为:
+ {
+ uid: {
+ children: [uid1, uid2],
+ data: {}
+ }
+ }
+
+transformObjectToTreeData(data)
+
+v0.9.3+
+
+将平级对象转树结构。transformTreeDataToObject方法的反向操作。
在canvas中模拟css的背景属性
引入:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'