新增库打包&修改文档

This commit is contained in:
wanglin25
2022-08-05 09:29:59 +08:00
parent 49d366628e
commit c7d2082944
29 changed files with 41 additions and 18 deletions

View File

@@ -20,25 +20,25 @@
## 目录介绍
1.simple-mind-map
1.`simple-mind-map`
思维导图工具库。
2.web
2.`web`
使用`simple-mind-map`工具库基于vue2.xElementUI搭建的在线思维导图。
使用`simple-mind-map`工具库,基于`vue2.x``ElementUI`搭建的在线思维导图。
3.dist
3.`dist`
打包后的资源文件夹。
4.docs
4.`docs`
文档等。
## 开发
本地开发
### 本地开发
```bash
git clone https://github.com/wanglin2/mind-map.git
@@ -52,7 +52,27 @@ npm link simple-mind-map
npm run serve
```
打包
### 打包
`0.2.0`版本开始增加了对核心库`simple-mind-map`的打包,复用了示例项目`web`的打包工具。
```bash
cd web
npm run buildLibrary
```
`simple-mind-map`库的`package.json`文件提供了两个导出字段:
```json
{
"module": "index.js",
"main": "./dist/simpleMindMap.umd.min.js",
}
```
支持`module`字段的环境会以`index.js`为入口,否则会以打包后的`simpleMindMap.umd.min.js`为入口。
### 打包demo
```bash
cd web
@@ -70,15 +90,17 @@ npm run build
npm i simple-mind-map
```
注意本项目为源码直接发布并未进行打包如果出现编译失败的情况Vue CLI创建的项目可以在vue.config.js文件中增加如下配置来让babel-loader编译本依赖
`0.2.0`版本之前的注意事项
```js
module.exports = {
transpileDependencies: ['simple-mind-map']
}
```
其他项目请自行修改打包配置。
>注意本项目为源码直接发布并未进行打包如果出现编译失败的情况Vue CLI创建的项目可以在vue.config.js文件中增加如下配置来让babel-loader编译本依赖
>
>```js
>module.exports = {
> transpileDependencies: ['simple-mind-map']
>}
>```
>
>其他项目请自行修改打包配置。
# API

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -18,8 +18,8 @@
"url": "https://github.com/wanglin2/mind-map"
},
"scripts": {},
"main": "index.js",
"type": "module",
"module": "index.js",
"main": "./dist/simpleMindMap.umd.min.js",
"dependencies": {
"@svgdotjs/svg.js": "^3.0.16",
"canvg": "^3.0.7",

View File

@@ -5,7 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build && node ../copy.js",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"buildLibrary": "vue-cli-service build --target lib --name simpleMindMap ../simple-mind-map/index.js --dest ../simple-mind-map/dist"
},
"dependencies": {
"@toast-ui/editor": "^3.1.5",