Doc: update

This commit is contained in:
街角小林
2024-08-12 13:50:38 +08:00
parent f15bf8a8dc
commit 8bbbc082c7
16 changed files with 233 additions and 183 deletions

View File

@@ -449,4 +449,8 @@ const mindMap = new MindMap({
<img src="./web/src/assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;" />
<span>Jeffrey</span>
</span>
<span>
<img src="./web/src/assets/avatar/张文建.jpg" style="width: 50px;height: 50px;" />
<span>张文建</span>
</span>
</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -10,7 +10,7 @@ let langList = [
path: 'en'
}
]
let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog']
let StartList = ['introduction', 'start', 'question', 'deploy', 'client', 'translate', 'changelog']
let CourseList = new Array(29).fill(0).map((_, index) => {
return 'course' + (index + 1)
})

View File

@@ -470,4 +470,8 @@ Open source is not easy. If this project is helpful to you, you can invite the a
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>Jeffrey</p>
</div>
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/张文建.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>张文建</p>
</div>
</div>

View File

@@ -8,18 +8,18 @@
</blockquote>
<h2>Features</h2>
<ul>
<li><input type="checkbox" id="checkbox34" checked="true" /><label for="checkbox34">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox35" checked="true" /><label for="checkbox35">Support logical structure chart(Left and Right Logical Structure Diagram), mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox36" checked="true" /><label for="checkbox36">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox37" checked="true" /><label for="checkbox37">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox38" checked="true" /><label for="checkbox38">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, Support for expanding node content, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox39" checked="true" /><label for="checkbox39">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox40" checked="true" /><label for="checkbox40">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox41" checked="true" /><label for="checkbox41">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code><code>txt</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox42" checked="true" /><label for="checkbox42">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, scrollbar, Hand drawn style, and rainbow lines</label></li>
<li><input type="checkbox" id="checkbox43" checked="true" /><label for="checkbox43">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox44" checked="true" /><label for="checkbox44">Support collaborative editing</label></li>
<li><input type="checkbox" id="checkbox45" checked="true" /><label for="checkbox45">Support demonstration mode</label></li>
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox18" checked="true" /><label for="checkbox18">Support logical structure chart(Left and Right Logical Structure Diagram), mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, Support for expanding node content, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code><code>txt</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox25" checked="true" /><label for="checkbox25">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, scrollbar, Hand drawn style, and rainbow lines</label></li>
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">Support collaborative editing</label></li>
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">Support demonstration mode</label></li>
</ul>
<p>The official provides the following plugins, which can be introduced as needed (a certain function may not be effective because you did not introduce the corresponding plugin). Please refer to the documentation for specific usage methods:</p>
<blockquote>
@@ -39,16 +39,16 @@ frameworks such as Vue and React, or without a framework.</p>
<p>This is an online mind map built using the <code>simple-mind-map</code> library and based
on <code>Vue2.x</code> and <code>ElementUI</code>. Features include:</p>
<ul>
<li><input type="checkbox" id="checkbox46" checked="true" /><label for="checkbox46">Toolbar, which supports inserting and deleting nodes, and editing node</label>
<li><input type="checkbox" id="checkbox29" checked="true" /><label for="checkbox29">Toolbar, which supports inserting and deleting nodes, and editing node</label>
images, icons, hyperlinks, notes, tags, and summaries</li>
<li><input type="checkbox" id="checkbox47" checked="true" /><label for="checkbox47">Sidebar, with panels for basic style settings, node style settings,</label>
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">Sidebar, with panels for basic style settings, node style settings,</label>
outline, theme selection, and structure selection</li>
<li><input type="checkbox" id="checkbox48" checked="true" /><label for="checkbox48">Import and export functionality; data is saved in the browser's local</label>
<li><input type="checkbox" id="checkbox31" checked="true" /><label for="checkbox31">Import and export functionality; data is saved in the browser's local</label>
storage by default, but it also supports creating, opening, and editing
local files on the computer directly</li>
<li><input type="checkbox" id="checkbox49" checked="true" /><label for="checkbox49">Right-click menu, which supports operations such as expanding, collapsing,</label>
<li><input type="checkbox" id="checkbox32" checked="true" /><label for="checkbox32">Right-click menu, which supports operations such as expanding, collapsing,</label>
and organizing layout</li>
<li><input type="checkbox" id="checkbox50" checked="true" /><label for="checkbox50">Bottom bar, which supports node and word count statistics, switching</label>
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">Bottom bar, which supports node and word count statistics, switching</label>
between edit and read-only modes, zooming in and out, and switching to
full screen, support mini map</li>
</ul>
@@ -426,6 +426,10 @@ full screen, support mini map</li>
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>Jeffrey</p>
</div>
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/张文建.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>张文建</p>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,50 @@
# Questions
## 1.Error when using in Vite, indicating xml-js dependency error
Solution: use the following import method:
```js
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min";
```
The `simple-mind-map` package provides the unpacked entry field `module`, and
the `xml-js` package dependency needs to import the package in the `node`
environment. Therefore, it cannot be obtained in `Vite` and an error will be
reported. Therefore, specify the import of the packed entry, and all relevant
packages are packed into the product, so there will be no error.
If you need to do further development, that is, you must use the unpacked code,
and if you do not need to parse the `xmind` file, you can remove the `xmind`
module. If you need it, you can try using other libraries to parse `xml` to
`json`.
## 2.Error `Getting bbox of element "text" is not possible: TypeError: Cannot read properties of undefined (reading 'apply')`
The reason is that the installed version of `@svgdotjs/svg.js` is too high. You can manually reduce it to the version of `3.0.16`.
## 3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46
The following configurations can be added to the packaging configuration file:
```js
resolve: { alias: { stream: "stream-browserify" } }
```
Different packaging tools may have different specific configurations, with the principle of excluding 'stream' dependencies.
## 4.When clicking the [New], [Open], or [Save As] buttons, it will prompt that the browser does not support it or is not using the HTTPS protocol.
The browser uses API [window.showOpenFilePicker](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker) to operate local files on the computer. If it is not supported, either the browser does not support this API or the page is not using the HTTPS protocol, You can press F12, or open the browser console through the right-click menu on the page and enter 'window.showOpenFilePicker' in the 'Console' tab. If it returns 'undefined', it means it is not supported. If it does not return this message and the page still prompts that the browser does not support it or is not using the HTTPS protocol, you can submit an issue or contact the author.
## 5.Import simple-mind-map error message, the error message is as follows:
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
This is because your build environment does not support this JavaScript syntax, which comes from the '@svgdotjs/svg.js' library. The solution is as follows:
1.Manually reduce the version of the '@svgdotjs/svg.js' library. You can manually install the lower version in your project, such as: `npm i @svgdotjs/svg.js@3.2.0`
2.If you don't reduce the version, you can modify the relevant configuration of your build tool, modify the configuration of 'babel', and have it compile the 'simple-mind-map' library in 'node.modules' or the '@svgdotjs/svg.js' library. If you are using 'vue-cli' or 'vite', they also provide the relevant configuration directly. In addition, it is necessary to install the 'babel' plugin that compiles this syntax and configure it in the 'babel' configuration file:
`@babel/plugin-proposal-nullish-coalescing-operator``@babel/plugin-proposal-optional-chaining`

View File

@@ -0,0 +1,44 @@
<template>
<div>
<h1>Questions</h1>
<h2>1.Error when using in Vite, indicating xml-js dependency error</h2>
<p>Solution: use the following import method:</p>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;simple-mind-map/dist/simpleMindMap.umd.min&quot;</span>;
</code></pre>
<p>The <code>simple-mind-map</code> package provides the unpacked entry field <code>module</code>, and
the <code>xml-js</code> package dependency needs to import the package in the <code>node</code>
environment. Therefore, it cannot be obtained in <code>Vite</code> and an error will be
reported. Therefore, specify the import of the packed entry, and all relevant
packages are packed into the product, so there will be no error.</p>
<p>If you need to do further development, that is, you must use the unpacked code,
and if you do not need to parse the <code>xmind</code> file, you can remove the <code>xmind</code>
module. If you need it, you can try using other libraries to parse <code>xml</code> to
<code>json</code>.</p>
<h2>2.Error <code>Getting bbox of element &quot;text&quot; is not possible: TypeError: Cannot read properties of undefined (reading 'apply')</code></h2>
<p>The reason is that the installed version of <code>@svgdotjs/svg.js</code> is too high. You can manually reduce it to the version of <code>3.0.16</code>.</p>
<h2>3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46</h2>
<p>The following configurations can be added to the packaging configuration file:</p>
<pre class="hljs"><code>resolve: { <span class="hljs-attr">alias</span>: { <span class="hljs-attr">stream</span>: <span class="hljs-string">&quot;stream-browserify&quot;</span> } }
</code></pre>
<p>Different packaging tools may have different specific configurations, with the principle of excluding 'stream' dependencies.</p>
<h2>4.When clicking the [New], [Open], or [Save As] buttons, it will prompt that the browser does not support it or is not using the HTTPS protocol.</h2>
<p>The browser uses API <a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker">window.showOpenFilePicker</a> to operate local files on the computer. If it is not supported, either the browser does not support this API or the page is not using the HTTPS protocol, You can press F12, or open the browser console through the right-click menu on the page and enter 'window.showOpenFilePicker' in the 'Console' tab. If it returns 'undefined', it means it is not supported. If it does not return this message and the page still prompts that the browser does not support it or is not using the HTTPS protocol, you can submit an issue or contact the author.</p>
<h2>5.Import simple-mind-map error message, the error message is as follows:</h2>
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
<p>This is because your build environment does not support this JavaScript syntax, which comes from the '@svgdotjs/svg.js' library. The solution is as follows:</p>
<p>1.Manually reduce the version of the '@svgdotjs/svg.js' library. You can manually install the lower version in your project, such as: <code>npm i @svgdotjs/svg.js@3.2.0</code></p>
<p>2.If you don't reduce the version, you can modify the relevant configuration of your build tool, modify the configuration of 'babel', and have it compile the 'simple-mind-map' library in 'node.modules' or the '@svgdotjs/svg.js' library. If you are using 'vue-cli' or 'vite', they also provide the relevant configuration directly. In addition, it is necessary to install the 'babel' plugin that compiles this syntax and configure it in the 'babel' configuration file:</p>
<p><code>@babel/plugin-proposal-nullish-coalescing-operator</code><code>@babel/plugin-proposal-optional-chaining</code></p>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -178,55 +178,4 @@ cd web
npm run build
```
The `index.html` file will be automatically moved to the root directory.
## Problems
### Error when using in Vite, indicating xml-js dependency error
Solution: use the following import method:
```js
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min";
```
The `simple-mind-map` package provides the unpacked entry field `module`, and
the `xml-js` package dependency needs to import the package in the `node`
environment. Therefore, it cannot be obtained in `Vite` and an error will be
reported. Therefore, specify the import of the packed entry, and all relevant
packages are packed into the product, so there will be no error.
If you need to do further development, that is, you must use the unpacked code,
and if you do not need to parse the `xmind` file, you can remove the `xmind`
module. If you need it, you can try using other libraries to parse `xml` to
`json`.
### Error `Getting bbox of element "text" is not possible: TypeError: Cannot read properties of undefined (reading 'apply')`
The reason is that the installed version of `@svgdotjs/svg.js` is too high. You can manually reduce it to the version of `3.0.16`.
### TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46
The following configurations can be added to the packaging configuration file:
```js
resolve: { alias: { stream: "stream-browserify" } }
```
Different packaging tools may have different specific configurations, with the principle of excluding 'stream' dependencies.
### When clicking the [New], [Open], or [Save As] buttons, it will prompt that the browser does not support it or is not using the HTTPS protocol.
The browser uses API [window.showOpenFilePicker](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker) to operate local files on the computer. If it is not supported, either the browser does not support this API or the page is not using the HTTPS protocol, You can press F12, or open the browser console through the right-click menu on the page and enter 'window.showOpenFilePicker' in the 'Console' tab. If it returns 'undefined', it means it is not supported. If it does not return this message and the page still prompts that the browser does not support it or is not using the HTTPS protocol, you can submit an issue or contact the author.
### 5.Import simple-mind-map error message, the error message is as follows:
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
This is because your build environment does not support this JavaScript syntax, which comes from the '@svgdotjs/svg.js' library. The solution is as follows:
1.Manually reduce the version of the '@svgdotjs/svg.js' library. You can manually install the lower version in your project, such as: `npm i @svgdotjs/svg.js@3.2.0`
2.If you don't reduce the version, you can modify the relevant configuration of your build tool, modify the configuration of 'babel', and have it compile the 'simple-mind-map' library in 'node.modules' or the '@svgdotjs/svg.js' library. If you are using 'vue-cli' or 'vite', they also provide the relevant configuration directly. In addition, it is necessary to install the 'babel' plugin that compiles this syntax and configure it in the 'babel' configuration file:
`@babel/plugin-proposal-nullish-coalescing-operator``@babel/plugin-proposal-optional-chaining`
The `index.html` file will be automatically moved to the root directory.

View File

@@ -122,35 +122,6 @@ npm run buildDoc
npm run build
</code></pre>
<p>The <code>index.html</code> file will be automatically moved to the root directory.</p>
<h2>Problems</h2>
<h3>Error when using in Vite, indicating xml-js dependency error</h3>
<p>Solution: use the following import method:</p>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;simple-mind-map/dist/simpleMindMap.umd.min&quot;</span>;
</code></pre>
<p>The <code>simple-mind-map</code> package provides the unpacked entry field <code>module</code>, and
the <code>xml-js</code> package dependency needs to import the package in the <code>node</code>
environment. Therefore, it cannot be obtained in <code>Vite</code> and an error will be
reported. Therefore, specify the import of the packed entry, and all relevant
packages are packed into the product, so there will be no error.</p>
<p>If you need to do further development, that is, you must use the unpacked code,
and if you do not need to parse the <code>xmind</code> file, you can remove the <code>xmind</code>
module. If you need it, you can try using other libraries to parse <code>xml</code> to
<code>json</code>.</p>
<h3>Error <code>Getting bbox of element &quot;text&quot; is not possible: TypeError: Cannot read properties of undefined (reading 'apply')</code></h3>
<p>The reason is that the installed version of <code>@svgdotjs/svg.js</code> is too high. You can manually reduce it to the version of <code>3.0.16</code>.</p>
<h3>TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46</h3>
<p>The following configurations can be added to the packaging configuration file:</p>
<pre class="hljs"><code>resolve: { <span class="hljs-attr">alias</span>: { <span class="hljs-attr">stream</span>: <span class="hljs-string">&quot;stream-browserify&quot;</span> } }
</code></pre>
<p>Different packaging tools may have different specific configurations, with the principle of excluding 'stream' dependencies.</p>
<h3>When clicking the [New], [Open], or [Save As] buttons, it will prompt that the browser does not support it or is not using the HTTPS protocol.</h3>
<p>The browser uses API <a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker">window.showOpenFilePicker</a> to operate local files on the computer. If it is not supported, either the browser does not support this API or the page is not using the HTTPS protocol, You can press F12, or open the browser console through the right-click menu on the page and enter 'window.showOpenFilePicker' in the 'Console' tab. If it returns 'undefined', it means it is not supported. If it does not return this message and the page still prompts that the browser does not support it or is not using the HTTPS protocol, you can submit an issue or contact the author.</p>
<h3>5.Import simple-mind-map error message, the error message is as follows:</h3>
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
<p>This is because your build environment does not support this JavaScript syntax, which comes from the '@svgdotjs/svg.js' library. The solution is as follows:</p>
<p>1.Manually reduce the version of the '@svgdotjs/svg.js' library. You can manually install the lower version in your project, such as: <code>npm i @svgdotjs/svg.js@3.2.0</code></p>
<p>2.If you don't reduce the version, you can modify the relevant configuration of your build tool, modify the configuration of 'babel', and have it compile the 'simple-mind-map' library in 'node.modules' or the '@svgdotjs/svg.js' library. If you are using 'vue-cli' or 'vite', they also provide the relevant configuration directly. In addition, it is necessary to install the 'babel' plugin that compiles this syntax and configure it in the 'babel' configuration file:</p>
<p><code>@babel/plugin-proposal-nullish-coalescing-operator</code><code>@babel/plugin-proposal-optional-chaining</code></p>
</div>
</template>

View File

@@ -49,6 +49,7 @@ export default [
{ path: 'richText', title: 'RichText插件' },
{ path: 'select', title: 'Select 插件 ' },
{ path: 'start', title: '开始' },
{ path: 'question', title: '常见问题' },
{ path: 'translate', title: '贡献' },
{ path: 'utils', title: '内置工具方法' },
{ path: 'view', title: 'View实例' },
@@ -97,6 +98,7 @@ export default [
{ path: 'richText', title: 'RichText plugin' },
{ path: 'select', title: 'Select plugin' },
{ path: 'start', title: 'Start' },
{ path: 'question', title: 'Questions' },
{ path: 'translate', title: 'Contribute' },
{ path: 'utils', title: 'Utility Methods' },
{ path: 'view', title: 'View instance' },

View File

@@ -468,4 +468,8 @@
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>Jeffrey</p>
</div>
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/张文建.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>张文建</p>
</div>
</div>

View File

@@ -8,18 +8,18 @@
</blockquote>
<h2>特性</h2>
<ul>
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox18" checked="true" /><label for="checkbox18">支持逻辑结构图向左向右逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">节点支持拖拽拖拽移动自由调整多种节点形状支持扩展节点内容支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code><code>txt</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox25" checked="true" /><label for="checkbox25">支持快捷键前进后退关联线搜索替换小地图水印滚动条手绘风格彩虹线条</label></li>
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">支持协同编辑</label></li>
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">支持演示模式</label></li>
<li><input type="checkbox" id="checkbox0" checked="true" /><label for="checkbox0">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox1" checked="true" /><label for="checkbox1">支持逻辑结构图向左向右逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox2" checked="true" /><label for="checkbox2">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox3" checked="true" /><label for="checkbox3">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox4" checked="true" /><label for="checkbox4">节点支持拖拽拖拽移动自由调整多种节点形状支持扩展节点内容支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox5" checked="true" /><label for="checkbox5">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox6" checked="true" /><label for="checkbox6">支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox7" checked="true" /><label for="checkbox7">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code><code>txt</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox8" checked="true" /><label for="checkbox8">支持快捷键前进后退关联线搜索替换小地图水印滚动条手绘风格彩虹线条</label></li>
<li><input type="checkbox" id="checkbox9" checked="true" /><label for="checkbox9">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox10" checked="true" /><label for="checkbox10">支持协同编辑</label></li>
<li><input type="checkbox" id="checkbox11" checked="true" /><label for="checkbox11">支持演示模式</label></li>
</ul>
<p>官方提供了如下插件可根据需求按需引入某个功能不生效大概率是因为你没有引入对应的插件具体使用方式请查看文档</p>
<blockquote>
@@ -37,11 +37,11 @@
<p>2.<code>web</code></p>
<p>使用<code>simple-mind-map</code>基于<code>vue2.x</code><code>ElementUI</code>搭建的在线思维导图特性</p>
<ul>
<li><input type="checkbox" id="checkbox29" checked="true" /><label for="checkbox29">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox31" checked="true" /><label for="checkbox31">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox32" checked="true" /><label for="checkbox32">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
<li><input type="checkbox" id="checkbox12" checked="true" /><label for="checkbox12">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox13" checked="true" /><label for="checkbox13">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox14" checked="true" /><label for="checkbox14">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox15" checked="true" /><label for="checkbox15">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox16" checked="true" /><label for="checkbox16">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
</ul>
<p>提供文档页面服务</p>
<p>3.<code>dist</code></p>
@@ -420,6 +420,10 @@
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>Jeffrey</p>
</div>
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/张文建.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>张文建</p>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,43 @@
# 常见问题
## 1.在Vite中使用报错提示xml-js依赖出错
解决方法:使用如下引入方式:
```js
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"
```
`simple-mind-map`包提供未打包的入口字段`module`,依赖的`xml-js`包需要引入`node`环境下的包,所以在`Vite`中获取不到会报错,所以指定引入打包后的入口,相关包都已打包进产物,所以不会报错。
如果需要二次开发,也就是必须要使用未打包代码的话,如果你不需要解析`xmind`文件的话,可以去除`xmind`模块,如果需要的话那么可以尝试换成其他的解析`xml``json`的库。
## 2.报错`Getting bbox of element "text" is not possible: TypeError: Cannot read properties of undefined (reading 'apply')`
原因为安装的`@svgdotjs/svg.js`版本太高,手动降到`3.0.16`版本即可。
## 3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46
可以在打包配置文件中增加如下配置:
```js
resolve: { alias: { stream: "stream-browserify" } }
```
不同的打包工具可能具体配置不一样,原理就是排除`stream`依赖。
## 4.点击【新建】、【打开】、【另存为】按钮时提示浏览器不支持或者非https协议。
浏览器上操作电脑本地文件使用的是[window.showOpenFilePicker](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker)api如果不支持要么是浏览器不支持这个API要么是因为页面非https协议你可以按F12或者在页面通过鼠标右键菜单中的【检查】打开浏览器控制台在其中的【控制台】或【console】tab中输入`window.showOpenFilePicker`按回车,如果返回`undefined`则代表不支持如果返回的不是这个而页面依旧提示提示浏览器不支持或者非https协议那么可以提交issue或者联系作者。
## 5.引入simple-mind-map报错报错信息如下
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
这是因为你的构建环境不支持该js语法该语法出自`@svgdotjs/svg.js`库,解决方法如下:
1.手动降低`@svgdotjs/svg.js`库的版本,你可以在你的项目中手动安装低版本,比如:`npm i @svgdotjs/svg.js@3.2.0`
2.不降低版本的话,可以通过修改你的构建工具的相关配置,修改`babel`的配置,让它编译一下`node_modules`中的`simple-mind-map`库,或`@svgdotjs/svg.js`库,如果用的是`vue-cli``vite`,它们也直接提供了相关配置。另外需要安装编译该语法的`babel`插件,并且配置到`babel`的配置文件中:
`@babel/plugin-proposal-nullish-coalescing-operator``@babel/plugin-proposal-optional-chaining`

View File

@@ -0,0 +1,37 @@
<template>
<div>
<h1>常见问题</h1>
<h2>1.在Vite中使用报错提示xml-js依赖出错</h2>
<p>解决方法使用如下引入方式</p>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;simple-mind-map/dist/simpleMindMap.umd.min&quot;</span>
</code></pre>
<p><code>simple-mind-map</code>包提供未打包的入口字段<code>module</code>依赖的<code>xml-js</code>包需要引入<code>node</code>环境下的包所以在<code>Vite</code>中获取不到会报错所以指定引入打包后的入口相关包都已打包进产物所以不会报错</p>
<p>如果需要二次开发也就是必须要使用未打包代码的话如果你不需要解析<code>xmind</code>文件的话可以去除<code>xmind</code>模块如果需要的话那么可以尝试换成其他的解析<code>xml</code><code>json</code>的库</p>
<h2>2.报错<code>Getting bbox of element &quot;text&quot; is not possible: TypeError: Cannot read properties of undefined (reading 'apply')</code></h2>
<p>原因为安装的<code>@svgdotjs/svg.js</code>版本太高手动降到<code>3.0.16</code>版本即可</p>
<h2>3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46</h2>
<p>可以在打包配置文件中增加如下配置</p>
<pre class="hljs"><code>resolve: { <span class="hljs-attr">alias</span>: { <span class="hljs-attr">stream</span>: <span class="hljs-string">&quot;stream-browserify&quot;</span> } }
</code></pre>
<p>不同的打包工具可能具体配置不一样原理就是排除<code>stream</code>依赖</p>
<h2>4.点击新建打开另存为按钮时提示浏览器不支持或者非https协议</h2>
<p>浏览器上操作电脑本地文件使用的是<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker">window.showOpenFilePicker</a>api如果不支持要么是浏览器不支持这个API要么是因为页面非https协议你可以按F12或者在页面通过鼠标右键菜单中的检查打开浏览器控制台在其中的控制台consoletab中输入<code>window.showOpenFilePicker</code>按回车如果返回<code>undefined</code>则代表不支持如果返回的不是这个而页面依旧提示提示浏览器不支持或者非https协议那么可以提交issue或者联系作者</p>
<h2>5.引入simple-mind-map报错报错信息如下</h2>
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
<p>这是因为你的构建环境不支持该js语法该语法出自<code>@svgdotjs/svg.js</code>解决方法如下</p>
<p>1.手动降低<code>@svgdotjs/svg.js</code>库的版本你可以在你的项目中手动安装低版本比如<code>npm i @svgdotjs/svg.js@3.2.0</code></p>
<p>2.不降低版本的话可以通过修改你的构建工具的相关配置修改<code>babel</code>的配置让它编译一下<code>node_modules</code>中的<code>simple-mind-map</code><code>@svgdotjs/svg.js</code>如果用的是<code>vue-cli</code><code>vite</code>它们也直接提供了相关配置另外需要安装编译该语法的<code>babel</code>插件并且配置到<code>babel</code>的配置文件中</p>
<p><code>@babel/plugin-proposal-nullish-coalescing-operator</code><code>@babel/plugin-proposal-optional-chaining</code></p>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -169,48 +169,4 @@ cd web
npm run build
```
会自动把`index.html`移动到根目录。
## 问题
### 1.在Vite中使用报错提示xml-js依赖出错
解决方法:使用如下引入方式:
```js
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"
```
`simple-mind-map`包提供未打包的入口字段`module`,依赖的`xml-js`包需要引入`node`环境下的包,所以在`Vite`中获取不到会报错,所以指定引入打包后的入口,相关包都已打包进产物,所以不会报错。
如果需要二次开发,也就是必须要使用未打包代码的话,如果你不需要解析`xmind`文件的话,可以去除`xmind`模块,如果需要的话那么可以尝试换成其他的解析`xml``json`的库。
### 2.报错`Getting bbox of element "text" is not possible: TypeError: Cannot read properties of undefined (reading 'apply')`
原因为安装的`@svgdotjs/svg.js`版本太高,手动降到`3.0.16`版本即可。
### 3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46
可以在打包配置文件中增加如下配置:
```js
resolve: { alias: { stream: "stream-browserify" } }
```
不同的打包工具可能具体配置不一样,原理就是排除`stream`依赖。
### 4.点击【新建】、【打开】、【另存为】按钮时提示浏览器不支持或者非https协议。
浏览器上操作电脑本地文件使用的是[window.showOpenFilePicker](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker)api如果不支持要么是浏览器不支持这个API要么是因为页面非https协议你可以按F12或者在页面通过鼠标右键菜单中的【检查】打开浏览器控制台在其中的【控制台】或【console】tab中输入`window.showOpenFilePicker`按回车,如果返回`undefined`则代表不支持如果返回的不是这个而页面依旧提示提示浏览器不支持或者非https协议那么可以提交issue或者联系作者。
### 5.引入simple-mind-map报错报错信息如下
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
这是因为你的构建环境不支持该js语法该语法出自`@svgdotjs/svg.js`库,解决方法如下:
1.手动降低`@svgdotjs/svg.js`库的版本,你可以在你的项目中手动安装低版本,比如:`npm i @svgdotjs/svg.js@3.2.0`
2.不降低版本的话,可以通过修改你的构建工具的相关配置,修改`babel`的配置,让它编译一下`node_modules`中的`simple-mind-map`库,或`@svgdotjs/svg.js`库,如果用的是`vue-cli``vite`,它们也直接提供了相关配置。另外需要安装编译该语法的`babel`插件,并且配置到`babel`的配置文件中:
`@babel/plugin-proposal-nullish-coalescing-operator``@babel/plugin-proposal-optional-chaining`
会自动把`index.html`移动到根目录。

View File

@@ -112,28 +112,6 @@ npm run buildDoc
npm run build
</code></pre>
<p>会自动把<code>index.html</code>移动到根目录</p>
<h2>问题</h2>
<h3>1.在Vite中使用报错提示xml-js依赖出错</h3>
<p>解决方法使用如下引入方式</p>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;simple-mind-map/dist/simpleMindMap.umd.min&quot;</span>
</code></pre>
<p><code>simple-mind-map</code>包提供未打包的入口字段<code>module</code>依赖的<code>xml-js</code>包需要引入<code>node</code>环境下的包所以在<code>Vite</code>中获取不到会报错所以指定引入打包后的入口相关包都已打包进产物所以不会报错</p>
<p>如果需要二次开发也就是必须要使用未打包代码的话如果你不需要解析<code>xmind</code>文件的话可以去除<code>xmind</code>模块如果需要的话那么可以尝试换成其他的解析<code>xml</code><code>json</code>的库</p>
<h3>2.报错<code>Getting bbox of element &quot;text&quot; is not possible: TypeError: Cannot read properties of undefined (reading 'apply')</code></h3>
<p>原因为安装的<code>@svgdotjs/svg.js</code>版本太高手动降到<code>3.0.16</code>版本即可</p>
<h3>3.TypeError: Cannot read properties of undefined (reading 'prototype') at sax.js:222:46</h3>
<p>可以在打包配置文件中增加如下配置</p>
<pre class="hljs"><code>resolve: { <span class="hljs-attr">alias</span>: { <span class="hljs-attr">stream</span>: <span class="hljs-string">&quot;stream-browserify&quot;</span> } }
</code></pre>
<p>不同的打包工具可能具体配置不一样原理就是排除<code>stream</code>依赖</p>
<h3>4.点击新建打开另存为按钮时提示浏览器不支持或者非https协议</h3>
<p>浏览器上操作电脑本地文件使用的是<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/showOpenFilePicker">window.showOpenFilePicker</a>api如果不支持要么是浏览器不支持这个API要么是因为页面非https协议你可以按F12或者在页面通过鼠标右键菜单中的检查打开浏览器控制台在其中的控制台consoletab中输入<code>window.showOpenFilePicker</code>按回车如果返回<code>undefined</code>则代表不支持如果返回的不是这个而页面依旧提示提示浏览器不支持或者非https协议那么可以提交issue或者联系作者</p>
<h3>5.引入simple-mind-map报错报错信息如下</h3>
<img src="../../../../assets/img/docs/错误.jpg" style="width: 850px" />
<p>这是因为你的构建环境不支持该js语法该语法出自<code>@svgdotjs/svg.js</code>解决方法如下</p>
<p>1.手动降低<code>@svgdotjs/svg.js</code>库的版本你可以在你的项目中手动安装低版本比如<code>npm i @svgdotjs/svg.js@3.2.0</code></p>
<p>2.不降低版本的话可以通过修改你的构建工具的相关配置修改<code>babel</code>的配置让它编译一下<code>node_modules</code>中的<code>simple-mind-map</code><code>@svgdotjs/svg.js</code>如果用的是<code>vue-cli</code><code>vite</code>它们也直接提供了相关配置另外需要安装编译该语法的<code>babel</code>插件并且配置到<code>babel</code>的配置文件中</p>
<p><code>@babel/plugin-proposal-nullish-coalescing-operator</code><code>@babel/plugin-proposal-optional-chaining</code></p>
</div>
</template>