diff --git a/index.html b/index.html index 1edde3bb..86b80ca1 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
The non-packaged 'ES' module is introduced by default, and only contains core functions, not unregistered plugin content, which can effectively reduce the size. However, you need to configure the babel compilation simple mind-map in your project to prevent some newer js syntax some browsers not supporting it.
If you need a file in the format of umd module, such as CDN in the browser, you can import it in the following way:
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min.js";
+If you need a file in the format of umd module, such as CDN in the browser, Then you can find the simpleMindMap.umd.min.js file in the /simple-mind-map/dist/ directory, copy it to your project, and then import it into the page:
+<script scr="simpleMindMap.umd.min.js"></script>
+A global variable window.simpleMindMap will be created.
The disadvantage of this method is that it will contain all the content, including the plugins you have not registered, so the overall volume will be relatively large.
Problems
Error when using in Vite, indicating xml-js dependency error
diff --git a/web/src/pages/Doc/en/translate/index.md b/web/src/pages/Doc/en/translate/index.md
index 27e08501..24f6cf27 100644
--- a/web/src/pages/Doc/en/translate/index.md
+++ b/web/src/pages/Doc/en/translate/index.md
@@ -1,6 +1,6 @@
# Participate in translation
-Thanks for the English translation provided by [Emircan ERKUL](https://github.com/emircanerkul).
+Thanks for the first version English translation provided by [Emircan ERKUL](https://github.com/emircanerkul).
If you want to participate in the translation of this document, you can clone this repository first.
diff --git a/web/src/pages/Doc/en/translate/index.vue b/web/src/pages/Doc/en/translate/index.vue
index 84db2194..2d560b58 100644
--- a/web/src/pages/Doc/en/translate/index.vue
+++ b/web/src/pages/Doc/en/translate/index.vue
@@ -1,7 +1,7 @@
Participate in translation
-Thanks for the English translation provided by Emircan ERKUL.
+Thanks for the first version English translation provided by Emircan ERKUL.
If you want to participate in the translation of this document, you can clone this repository first.
The translated documents are in the /web/src/pages/Doc/ directory, and currently support English(en) and Simplified Chinese(zh).
If you are adding a new language type, you can create a new directory under the /web/src/pages/Doc/ directory, Then create a folder for each chapter, You can also directly copy all chapter directories under the existing language directory for translation, Note that you only need to write the index.md file, The index.vue file under the chapter directory is automatically generated by the script according to index.md.
diff --git a/web/src/pages/Doc/zh/start/index.md b/web/src/pages/Doc/zh/start/index.md
index b01e6ac9..05147e31 100644
--- a/web/src/pages/Doc/zh/start/index.md
+++ b/web/src/pages/Doc/zh/start/index.md
@@ -92,12 +92,14 @@ const mindMap = new MindMap({
默认引入的是未打包的`ES`模块,且只包含核心功能,不包含未注册的插件内容,能有效减小体积,不过你需要在你的项目中配置`babel`编译`simple-mind-map`,防止一些较新的`js`语法部分浏览器不支持。
-如果你需要`umd`模块格式的文件,比如以`CDN`的方式在浏览器上使用,那么你可以使用如下方式引入:
+如果你需要`umd`模块格式的文件,比如以`CDN`的方式在浏览器上使用,那么你可以从`/simple-mind-map/dist/`目录中找到`simpleMindMap.umd.min.js`文件,复制到你的项目中,然后在页面中引入:
-```js
-import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min.js";
+```html
+
```
+会创建一个全局变量`window.simpleMindMap`。
+
这种方式的缺点是会包含所有的内容,包括你没有注册的插件,所以整体体积会比较大。
## 问题
diff --git a/web/src/pages/Doc/zh/start/index.vue b/web/src/pages/Doc/zh/start/index.vue
index 160754ba..53e6a993 100644
--- a/web/src/pages/Doc/zh/start/index.vue
+++ b/web/src/pages/Doc/zh/start/index.vue
@@ -62,9 +62,10 @@ npm run build
});
默认引入的是未打包的ES模块,且只包含核心功能,不包含未注册的插件内容,能有效减小体积,不过你需要在你的项目中配置babel编译simple-mind-map,防止一些较新的js语法部分浏览器不支持。
-如果你需要umd模块格式的文件,比如以CDN的方式在浏览器上使用,那么你可以使用如下方式引入:
-import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min.js";
+如果你需要umd模块格式的文件,比如以CDN的方式在浏览器上使用,那么你可以从/simple-mind-map/dist/目录中找到simpleMindMap.umd.min.js文件,复制到你的项目中,然后在页面中引入:
+<script scr="simpleMindMap.umd.min.js"></script>
+会创建一个全局变量window.simpleMindMap。
这种方式的缺点是会包含所有的内容,包括你没有注册的插件,所以整体体积会比较大。
问题
1.在Vite中使用报错,提示xml-js依赖出错
diff --git a/web/src/pages/Doc/zh/translate/index.md b/web/src/pages/Doc/zh/translate/index.md
index 09b20903..91bb9743 100644
--- a/web/src/pages/Doc/zh/translate/index.md
+++ b/web/src/pages/Doc/zh/translate/index.md
@@ -1,6 +1,6 @@
# 参与翻译
-感谢[Emircan ERKUL](https://github.com/emircanerkul)提供的英文翻译。
+感谢[Emircan ERKUL](https://github.com/emircanerkul)提供的第一版英文翻译。
如果你也想参与翻译本文档的话,可以先克隆本仓库。
diff --git a/web/src/pages/Doc/zh/translate/index.vue b/web/src/pages/Doc/zh/translate/index.vue
index 5d49a646..f5ad4124 100644
--- a/web/src/pages/Doc/zh/translate/index.vue
+++ b/web/src/pages/Doc/zh/translate/index.vue
@@ -1,7 +1,7 @@
参与翻译
-感谢Emircan ERKUL提供的英文翻译。
+感谢Emircan ERKUL提供的第一版英文翻译。
如果你也想参与翻译本文档的话,可以先克隆本仓库。
翻译的文档在/web/src/pages/Doc/目录下,目前支持英文(en)、简体中文(zh)两种语言。
如果是新增一种语言类型,那么可以在/web/src/pages/Doc/目录下创建一个新目录,然后给每个章节创建一个文件夹,你也可以直接复制已存在的语言目录下的所有章节目录进行翻译,注意,你只需要编写index.md文件,章节目录下的index.vue文件是脚本根据index.md自动生成的。