diff --git a/README.md b/README.md
index 56a2fb42..47bdbd6a 100644
--- a/README.md
+++ b/README.md
@@ -449,4 +449,8 @@ const mindMap = new MindMap({
Jeffrey
+
+
+ 张文建
+
Jeffrey
+张文建
+json、png、svg、pdf、markdown、xmind、txt, support import from json、xmind、markdownjson、png、svg、pdf、markdown、xmind、txt, support import from json、xmind、markdownThe 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:
@@ -39,16 +39,16 @@ frameworks such as Vue and React, or without a framework.This is an online mind map built using the
simple-mind-maplibrary and based onVue2.xandElementUI. Features include:-
@@ -426,6 +426,10 @@ full screen, support mini map- +
- images, icons, hyperlinks, notes, tags, and summaries
-- +
- outline, theme selection, and structure selection
-- +
- storage by default, but it also supports creating, opening, and editing local files on the computer directly
-- +
- and organizing layout
-- +
- between edit and read-only modes, zooming in and out, and switching to full screen, support mini map
![]()
Jeffrey
++diff --git a/web/src/pages/Doc/en/question/index.md b/web/src/pages/Doc/en/question/index.md new file mode 100644 index 00000000..4697147d --- /dev/null +++ b/web/src/pages/Doc/en/question/index.md @@ -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: + ++
张文建
++ +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`。 \ No newline at end of file diff --git a/web/src/pages/Doc/en/question/index.vue b/web/src/pages/Doc/en/question/index.vue new file mode 100644 index 00000000..417937b8 --- /dev/null +++ b/web/src/pages/Doc/en/question/index.vue @@ -0,0 +1,44 @@ + +
++ + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/en/start/index.md b/web/src/pages/Doc/en/start/index.md index 7fb417c1..38d4ae57 100644 --- a/web/src/pages/Doc/en/start/index.md +++ b/web/src/pages/Doc/en/start/index.md @@ -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: - -Questions
+1.Error when using in Vite, indicating xml-js dependency error
+Solution: use the following import method:
++import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"; +The
+simple-mind-mappackage provides the unpacked entry fieldmodule, and +thexml-jspackage dependency needs to import the package in thenode+environment. Therefore, it cannot be obtained inViteand 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
+xmindfile, you can remove thexmind+module. If you need it, you can try using other libraries to parsexmlto +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.jsis too high. You can manually reduce it to the version of3.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:
++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 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:
++
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.02.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。- -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`。 \ No newline at end of file +The `index.html` file will be automatically moved to the root directory. \ No newline at end of file diff --git a/web/src/pages/Doc/en/start/index.vue b/web/src/pages/Doc/en/start/index.vue index 2458dfc2..2bf9ccab 100644 --- a/web/src/pages/Doc/en/start/index.vue +++ b/web/src/pages/Doc/en/start/index.vue @@ -122,35 +122,6 @@ npm run buildDoc npm run build
The
-index.htmlfile 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:
--import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"; -The
-simple-mind-mappackage provides the unpacked entry fieldmodule, and -thexml-jspackage dependency needs to import the package in thenode-environment. Therefore, it cannot be obtained inViteand 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
-xmindfile, you can remove thexmind-module. If you need it, you can try using other libraries to parsexmlto -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.jsis too high. You can manually reduce it to the version of3.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:
--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 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:
--
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.02.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:
-diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js index 9c00f970..203ccf7e 100644 --- a/web/src/pages/Doc/routerList.js +++ b/web/src/pages/Doc/routerList.js @@ -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' }, diff --git a/web/src/pages/Doc/zh/introduction/index.md b/web/src/pages/Doc/zh/introduction/index.md index d6221cd7..25909c75 100644 --- a/web/src/pages/Doc/zh/introduction/index.md +++ b/web/src/pages/Doc/zh/introduction/index.md @@ -468,4 +468,8 @@
@babel/plugin-proposal-nullish-coalescing-operator、@babel/plugin-proposal-optional-chaining。![]()
Jeffrey
++\ No newline at end of file diff --git a/web/src/pages/Doc/zh/introduction/index.vue b/web/src/pages/Doc/zh/introduction/index.vue index 6c018d44..2749df26 100644 --- a/web/src/pages/Doc/zh/introduction/index.vue +++ b/web/src/pages/Doc/zh/introduction/index.vue @@ -8,18 +8,18 @@+
张文建
+
json、png、svg、pdf、markdown、xmind、txt,支持从json、xmind、markdown导入json、png、svg、pdf、markdown、xmind、txt,支持从json、xmind、markdown导入官方提供了如下插件,可根据需求按需引入(某个功能不生效大概率是因为你没有引入对应的插件),具体使用方式请查看文档:
@@ -37,11 +37,11 @@2.
web使用
simple-mind-map库,基于vue2.x、ElementUI搭建的在线思维导图。特性:- - - - - + + + + +
提供文档页面服务。
3.
@@ -420,6 +420,10 @@dist![]()
Jeffrey
++diff --git a/web/src/pages/Doc/zh/question/index.md b/web/src/pages/Doc/zh/question/index.md new file mode 100644 index 00000000..8f6827bd --- /dev/null +++ b/web/src/pages/Doc/zh/question/index.md @@ -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报错,报错信息如下: + ++
张文建
++ +这是因为你的构建环境不支持该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`。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/question/index.vue b/web/src/pages/Doc/zh/question/index.vue new file mode 100644 index 00000000..69dc4f9e --- /dev/null +++ b/web/src/pages/Doc/zh/question/index.vue @@ -0,0 +1,37 @@ + +
++ + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/zh/start/index.md b/web/src/pages/Doc/zh/start/index.md index 4a51dd1e..3b51f483 100644 --- a/web/src/pages/Doc/zh/start/index.md +++ b/web/src/pages/Doc/zh/start/index.md @@ -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报错,报错信息如下: - -常见问题
+1.在Vite中使用报错,提示xml-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
+可以在打包配置文件中增加如下配置:
++resolve: { alias: { stream: "stream-browserify" } } +不同的打包工具可能具体配置不一样,原理就是排除
+stream依赖。4.点击【新建】、【打开】、【另存为】按钮时提示浏览器不支持,或者非https协议。
+浏览器上操作电脑本地文件使用的是window.showOpenFilePickerapi,如果不支持,要么是浏览器不支持这个API,要么是因为页面非https协议,你可以按F12,或者在页面通过鼠标右键菜单中的【检查】打开浏览器控制台,在其中的【控制台】或【console】tab中输入
+window.showOpenFilePicker按回车,如果返回undefined则代表不支持,如果返回的不是这个,而页面依旧提示提示浏览器不支持,或者非https协议,那么可以提交issue,或者联系作者。5.引入simple-mind-map报错,报错信息如下:
++
这是因为你的构建环境不支持该js语法,该语法出自
+@svgdotjs/svg.js库,解决方法如下:1.手动降低
+@svgdotjs/svg.js库的版本,你可以在你的项目中手动安装低版本,比如:npm i @svgdotjs/svg.js@3.2.02.不降低版本的话,可以通过修改你的构建工具的相关配置,修改
+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。- -这是因为你的构建环境不支持该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`。 \ No newline at end of file +会自动把`index.html`移动到根目录。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/start/index.vue b/web/src/pages/Doc/zh/start/index.vue index 650b5ad4..981585ae 100644 --- a/web/src/pages/Doc/zh/start/index.vue +++ b/web/src/pages/Doc/zh/start/index.vue @@ -112,28 +112,6 @@ npm run buildDoc npm run build
会自动把
-index.html移动到根目录。问题
-1.在Vite中使用报错,提示xml-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
-可以在打包配置文件中增加如下配置:
--resolve: { alias: { stream: "stream-browserify" } } -不同的打包工具可能具体配置不一样,原理就是排除
-stream依赖。4.点击【新建】、【打开】、【另存为】按钮时提示浏览器不支持,或者非https协议。
-浏览器上操作电脑本地文件使用的是window.showOpenFilePickerapi,如果不支持,要么是浏览器不支持这个API,要么是因为页面非https协议,你可以按F12,或者在页面通过鼠标右键菜单中的【检查】打开浏览器控制台,在其中的【控制台】或【console】tab中输入
-window.showOpenFilePicker按回车,如果返回undefined则代表不支持,如果返回的不是这个,而页面依旧提示提示浏览器不支持,或者非https协议,那么可以提交issue,或者联系作者。5.引入simple-mind-map报错,报错信息如下:
--
这是因为你的构建环境不支持该js语法,该语法出自
-@svgdotjs/svg.js库,解决方法如下:1.手动降低
-@svgdotjs/svg.js库的版本,你可以在你的项目中手动安装低版本,比如:npm i @svgdotjs/svg.js@3.2.02.不降低版本的话,可以通过修改你的构建工具的相关配置,修改
-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。