diff --git a/index.html b/index.html index 0ecbf961..ad7a6fcf 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -一个简单的web思维导图实现
\ No newline at end of file +一个简单的web思维导图实现
\ No newline at end of file diff --git a/web/src/assets/avatar/Think.jpg b/web/src/assets/avatar/Think.jpg new file mode 100644 index 00000000..58ca19ea Binary files /dev/null and b/web/src/assets/avatar/Think.jpg differ diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index 42779d59..bcb2b962 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -10,7 +10,7 @@ let langList = [ path: 'en' } ] -let StartList = ['introduction', 'start', 'translate', 'changelog'] +let StartList = ['introduction', 'start', 'deploy', 'translate', 'changelog'] let CourseList = new Array(18).fill(0).map((_, index) => { return 'course' + (index + 1) }) diff --git a/web/src/pages/Doc/en/deploy/index.md b/web/src/pages/Doc/en/deploy/index.md new file mode 100644 index 00000000..4a8d593f --- /dev/null +++ b/web/src/pages/Doc/en/deploy/index.md @@ -0,0 +1 @@ +# Deploy \ No newline at end of file diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js index 185bf6c9..d9c148b7 100644 --- a/web/src/pages/Doc/routerList.js +++ b/web/src/pages/Doc/routerList.js @@ -41,7 +41,8 @@ export default [ { path: 'utils', title: '内置工具方法' }, { path: 'view', title: 'View实例' }, { path: 'watermark', title: 'Watermark插件' }, - { path: 'xmind', title: 'XMind解析' } + { path: 'xmind', title: 'XMind解析' }, + { path: 'deploy', title: '部署' } ] }, { @@ -68,7 +69,8 @@ export default [ { path: 'utils', title: 'Utility Methods' }, { path: 'view', title: 'View instance' }, { path: 'watermark', title: 'Watermark plugin' }, - { path: 'xmind', title: 'XMind parse' } + { path: 'xmind', title: 'XMind parse' }, + { path: 'deploy', title: 'Deploy' } ] } ] diff --git a/web/src/pages/Doc/zh/deploy/index.md b/web/src/pages/Doc/zh/deploy/index.md new file mode 100644 index 00000000..a9ac7f0c --- /dev/null +++ b/web/src/pages/Doc/zh/deploy/index.md @@ -0,0 +1,66 @@ +# 部署 + +本项目的`web`目录下提供了一个基于`simple-mind-map`库、`Vue2.x`、`ElementUI`开发的完整项目,数据默认存储在电脑本地,此外可以操作电脑本地文件,原意是作为一个线上`demo`,但是也完全可以直接把它当做一个在线版思维导图应用使用,在线地址:[https://wanglin2.github.io/mind-map/](https://wanglin2.github.io/mind-map/)。 + +如果你的网络环境访问`GitHub`服务很慢,你也可以部署到你的服务器上。 + +## 部署到静态文件服务器 + +项目本身不依赖后端,所以完全可以部署到一个静态文件服务器上,可以依次执行如下命令: + +```bash +git clone https://github.com/wanglin2/mind-map.git +cd mind-map +cd simple-mind-map +npm i +npm link +cd .. +cd web +npm i +npm link simple-mind-map +``` + +然后你可以选择启动本地服务: + +```bash +npm run serve +``` + +也可以直接打包生成构建产物: + +```bash +npm run build +``` + +打包完后的入口页面`index.html`可以在项目根目录找到,对应的静态资源在根目录下的`dist`目录,`html`文件中会通过相对路径访问`dist`目录的资源,比如`dist/xxx`。你可以直接把这两个文件或目录上传到你的静态文件服务器,事实上,本项目就是这样部署到`GitHub Pages`上的。 + +如果你没有代码修改需求的话,直接从本仓库复制这些文件也是可以的。 + +如果你想把`index.html`也打包进`dist`目录,可以修改`web/package.json`文件的`scripts.build`命令,把`vue-cli-service build && node ../copy.js`中的` && node ../copy.js`删除即可。 + +如果你想修改打包输出的目录,可以修改`web/vue.config.js`文件的`outputDir`配置,改成你想要输出的路径即可。 + +如果你想修改`index.html`文件引用静态资源的路径的话可以修改`web/vue.config.js`文件的`publicPath`配置。 + +另外默认使用的是`hash`路由,也就是路径中会在`#`,如果你想使用`history`路由,可以修改`web/src/router.js`文件,将: + +```js +const router = new VueRouter({ + routes +}) +``` + +改成: + +```js +const router = new VueRouter({ + mode: 'history', + routes +}) +``` + +不过这需要后台支持,因为我们的应用是个单页客户端应用,如果后台没有正确的配置,当用户在浏览器直接访问子路由时会返回404,所以呢你要在服务端增加一个覆盖所有情况的候选资源:如果`URL`匹配不到任何静态资源,则应该返回同一个`index.html`页面。 + +## Docker + +编写中。。。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/deploy/index.vue b/web/src/pages/Doc/zh/deploy/index.vue new file mode 100644 index 00000000..b3ca8173 --- /dev/null +++ b/web/src/pages/Doc/zh/deploy/index.vue @@ -0,0 +1,55 @@ + + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/zh/introduction/index.md b/web/src/pages/Doc/zh/introduction/index.md index 0411157f..270bf24b 100644 --- a/web/src/pages/Doc/zh/introduction/index.md +++ b/web/src/pages/Doc/zh/introduction/index.md @@ -99,4 +99,11 @@ - \ No newline at end of file + + +
+
+ +

Think

+
+
\ 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 81ca2b65..df61c21b 100644 --- a/web/src/pages/Doc/zh/introduction/index.vue +++ b/web/src/pages/Doc/zh/introduction/index.vue @@ -7,19 +7,19 @@

特性

仓库目录介绍

1.simple-mind-map

@@ -27,11 +27,11 @@

2.web

使用simple-mind-map库,基于vue2.xElementUI搭建的在线思维导图。特性:

提供文档页面服务。

3.dist

@@ -67,6 +67,12 @@ +
+
+ +

Think

+
+