From d735be1204fd6330b366fb9283341ab7610a9a0d 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: Thu, 25 Jul 2024 18:33:36 +0800 Subject: [PATCH] Doc: update --- web/src/pages/Doc/en/start/index.md | 2 +- web/src/pages/Doc/en/start/index.vue | 2 +- web/src/pages/Doc/zh/start/index.md | 2 +- web/src/pages/Doc/zh/start/index.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/pages/Doc/en/start/index.md b/web/src/pages/Doc/en/start/index.md index 720b6ca4..7fb417c1 100644 --- a/web/src/pages/Doc/en/start/index.md +++ b/web/src/pages/Doc/en/start/index.md @@ -225,7 +225,7 @@ The browser uses API [window.showOpenFilePicker](https://developer.mozilla.org/z 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.0.16` +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: diff --git a/web/src/pages/Doc/en/start/index.vue b/web/src/pages/Doc/en/start/index.vue index f2e20f14..2458dfc2 100644 --- a/web/src/pages/Doc/en/start/index.vue +++ b/web/src/pages/Doc/en/start/index.vue @@ -148,7 +148,7 @@ module. If you need it, you can try using other libraries to parse xml5.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.0.16

+

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

diff --git a/web/src/pages/Doc/zh/start/index.md b/web/src/pages/Doc/zh/start/index.md index ddb9cafd..4a51dd1e 100644 --- a/web/src/pages/Doc/zh/start/index.md +++ b/web/src/pages/Doc/zh/start/index.md @@ -209,7 +209,7 @@ resolve: { alias: { stream: "stream-browserify" } } 这是因为你的构建环境不支持该js语法,该语法出自`@svgdotjs/svg.js`库,解决方法如下: -1.手动降低`@svgdotjs/svg.js`库的版本,你可以在你的项目中手动安装低版本,比如:`npm i @svgdotjs/svg.js@3.0.16` +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`的配置文件中: diff --git a/web/src/pages/Doc/zh/start/index.vue b/web/src/pages/Doc/zh/start/index.vue index 8e060bda..650b5ad4 100644 --- a/web/src/pages/Doc/zh/start/index.vue +++ b/web/src/pages/Doc/zh/start/index.vue @@ -131,7 +131,7 @@ npm run build

5.引入simple-mind-map报错,报错信息如下:

这是因为你的构建环境不支持该js语法,该语法出自@svgdotjs/svg.js库,解决方法如下:

-

1.手动降低@svgdotjs/svg.js库的版本,你可以在你的项目中手动安装低版本,比如:npm i @svgdotjs/svg.js@3.0.16

+

1.手动降低@svgdotjs/svg.js库的版本,你可以在你的项目中手动安装低版本,比如:npm i @svgdotjs/svg.js@3.2.0

2.不降低版本的话,可以通过修改你的构建工具的相关配置,修改babel的配置,让它编译一下node_modules中的simple-mind-map库,或@svgdotjs/svg.js库,如果用的是vue-clivite,它们也直接提供了相关配置。另外需要安装编译该语法的babel插件,并且配置到babel的配置文件中:

@babel/plugin-proposal-nullish-coalescing-operator@babel/plugin-proposal-optional-chaining