diff --git a/README.md b/README.md index 3a572fc2..c409481e 100755 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Solution of management system front-end based on `vue.js` and `ElementUI` Welcome everyone to maintain -[Documentation (English)](https://fairyever.github.io/d2admin-vue-element-doc/) / [中文文档](https://fairyever.github.io/d2admin-vue-element-doc/zh/) +[Documentation (English)](https://fairyever.github.io/d2admin-vue-element/) / [中文文档](https://fairyever.github.io/d2admin-vue-element/zh/) [Online preview / 在线预览](http://d2admin.fairyever.com/) @@ -128,91 +128,4 @@ v8.11.1 edunpm - http://registry.enpmjs.org/ ``` -> Not recommended for use `cnpm` - -## preview - -login - -![Snip20180526_1](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_1.png) - -dashboard - -![Snip20180526_2](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_2.png) - -mock data demo - -![Snip20180526_3](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_3.png) - -dragable and modified size card - -![Snip20180526_4](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_4.png) - -dragable layout - -![Snip20180526_5](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_5.png) - -multi-language support - -![Snip20180526_6](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_6.png) - -import `csv` `xlsx` -export `csv` `xlsx` and text - -![Snip20180526_7](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_7.png) - -![Snip20180526_8](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_8.png) - -three modes page container component - -![Snip20180526_9](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_9.png) - -integrated rich text editor - -![Snip20180526_10](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_10.png) - -integrated markdown editor - -![Snip20180526_11](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_11.png) - -integrated icon font - -![Snip20180526_12](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_12.png) - -encapsulation icon component - -![Snip20180526_13](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_13.png) - -support automatically import SVG folder icon, and through the use of components - -![Snip20180526_14](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_14.png) - -icon selector component - -![Snip20180526_15](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_15.png) - -Integrated markdown rendering function and optimized the Baidu cloud sharing link in the rendering result display - -![Snip20180526_16](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_16.png) - -integrated digital animation plug-in - -![Snip20180526_17](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_17.png) - -hightLight in source code viewer - -![Snip20180526_18](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_18.png) - -integrated chart - -![Snip20180526_19](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_19.png) - -support chart drag and resize and drag and drop locations - -![Snip20180526_20](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_20.png) - -separate chart example - -![Snip20180526_21](https://raw.githubusercontent.com/FairyEver/d2admin-vue-element/master/doc/image/Snip20180526_21.png) - - +> Not recommended for use `cnpm` \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000..91de84cd --- /dev/null +++ b/deploy.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +# 确保脚本抛出遇到的错误 +set -e + +# 生成静态文件 +npm run doc:build + +# 进入生成的文件夹 +cd docs/.vuepress/dist + +# 如果是发布到自定义域名 +# echo 'www.example.com' > CNAME + +git init +git add -A +git commit -m 'deploy' + +# 如果发布到 https://.github.io +# git push -f git@github.com:/.github.io.git master + +# 如果发布到 https://.github.io/ +git push -f git@github.com:FairyEver/d2admin-vue-element.git master:gh-pages + +cd - \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js new file mode 100644 index 00000000..071e74dd --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,94 @@ +module.exports = { + base: '/d2admin-vue-element/', + locales: { + '/': { + lang: 'en-US', + title: 'D2 Admin', + description: 'An elegant template for management system' + }, + '/zh/': { + lang: 'zh-CN', + title: 'D2 Admin', + description: '做一个优雅的管理系统模板' + } + }, + themeConfig: { + // 项目仓库地址 + repo: 'https://github.com/FairyEver/d2admin-vue-element', + // 自定义仓库链接文字 + repoLabel: '查看源码', + // 文档不是放在仓库的根目录下 + docsDir: 'docs', + // 默认是 false, 设置为 true 来启用 + editLinks: true, + // 多国语言 + locales: { + '/': { + selectText: 'Languages', + label: 'English', + editLinkText: 'Edit this page on GitHub', + lastUpdated: 'Last update' + }, + '/zh/': { + selectText: '选择语言', + label: '简体中文', + editLinkText: '在 GitHub 上编辑此页', + lastUpdated: '最后更新', + nav: [ + { text: '指南', link: '/zh/guide/' }, + { text: '插件', link: '/zh/plugins/' }, + { text: '组件', link: '/zh/components/' }, + { text: '下载', link: 'https://github.com/FairyEver/d2admin-vue-element/releases' } + ], + sidebar: { + '/zh/guide/': sideBarGuide('指南'), + '/zh/plugins/': sideBarPlugins('插件'), + '/zh/components/': sideBarComponents('组件') + } + } + } + } +} + +function sideBarGuide (title) { + return [ + { + title, + collapsable: false, + children: [ + '', + 'q-a', + 'change-log' + ] + } + ] +} + +function sideBarPlugins () { + return [ + 'data-export', + 'data-import', + 'i18n', + 'mock', + 'timeago' + ] +} + +function sideBarComponents (title) { + return [ + { + title, + collapsable: false, + children: [ + 'charts', + 'container', + 'count-up', + 'highlight', + 'icon-select', + 'icon-svg', + 'icon', + 'markdown' + ] + } + ] +} diff --git a/docs/.vuepress/override.styl b/docs/.vuepress/override.styl new file mode 100644 index 00000000..daf6b999 --- /dev/null +++ b/docs/.vuepress/override.styl @@ -0,0 +1 @@ +$accentColor = #409EFF \ No newline at end of file diff --git a/docs/.vuepress/public/logo@2x.png.REMOVED.git-id b/docs/.vuepress/public/logo@2x.png.REMOVED.git-id new file mode 100644 index 00000000..c43aa1d8 --- /dev/null +++ b/docs/.vuepress/public/logo@2x.png.REMOVED.git-id @@ -0,0 +1 @@ +d9ade30cf874de657275755e4783fde51f2f6ffc \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..429cf782 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,29 @@ +--- +home: true +heroImage: /logo@2x.png +actionText: Get Started → +actionLink: /zh/guide/ +features: +- title: Advocate succinct + details: On the visual basis of element UI, we have added some customization. +- title: Vue-Powered + details: Enjoy the dev experience of Vue + webpack, Ultra fast virtual DOM and the most economical optimization. +- title: ElementUI component library + details: Integrated and robust ElementUI, and use any ElementUI component at will. +footer: MIT Licensed | Copyright © 2018-present FairyEver +--- + +**The English document will be launched in the future. Please move to the Chinese document.** + +**英文文档会在稍后推出,现请移步右上角中文文档** + +``` +// chone +git clone https://github.com/FairyEver/d2admin-vue-element.git +// install package +npm i +// run +npm run dev +// build +npm run build +``` \ No newline at end of file diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 00000000..2b69474c --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,25 @@ +--- +home: true +heroImage: /logo@2x.png +actionText: 快速上手 → +actionLink: /zh/guide/ +features: +- title: 简洁至上 + details: 在 element UI 的视觉基础上稍加定制。 +- title: Vue驱动 + details: 享受 Vue + webpack 的开发体验,超快虚拟 DOM 和最省心的优化。 +- title: ElementUI组件库 + details: 集成完善且强大的 ElementUI,随意搭配使用任何 ElementUI 组件。 +footer: MIT Licensed | Copyright © 2018-present FairyEver +--- + +``` +// 克隆仓库 +git clone https://github.com/FairyEver/d2admin-vue-element.git +// 安装依赖 +npm i +// 运行 +npm run dev +// 打包 +npm run build +``` \ No newline at end of file diff --git a/docs/zh/components/README.md b/docs/zh/components/README.md new file mode 100644 index 00000000..a87c99eb --- /dev/null +++ b/docs/zh/components/README.md @@ -0,0 +1,3 @@ +# 组件概述 + +d2admin-vue-element(以下简称 d2admin)封装(或者集成第三方)了一些组件,方便开发者进行开发,具体组件文档请从左侧列表进入 \ No newline at end of file diff --git a/docs/zh/components/charts.md b/docs/zh/components/charts.md new file mode 100644 index 00000000..13e21434 --- /dev/null +++ b/docs/zh/components/charts.md @@ -0,0 +1,72 @@ +# 图表 + +## 介绍 + +D2Admin 集成了由蚂蚁金服出品的 **G2** 图表库 + +## 实现方式 + +`src/components/charts/register.js` 为注册图表组件的文件 + +`src/components/charts/G2` 为图表组件存放位置 + +`src/components/charts/G2/mixins/G2.js` 是图表最主要的文件,这是一个所有的图表组件都会使用的 mixin,这个 mixin 主要有以下用途 + + - 将 G2 和 DataSet 绑定到 data 上,方便组件使用,省去重复 `import G2 from '@antv/g2'` 等 + - 将 [G2 Chart类](http://antv.alipay.com/zh-cn/g2/3.x/api/chart.html#_Chart) 的属性全部暴露为 Vue 组件参数,这些参数会在初始化图表时用到 + - 提供了额外的设置参数,比如自动高度,自动初始化,初始化延时 + - 关闭 G2 的体验改进计划打点请求 + - data 上的 chart 对象 + - 自动初始化(或者不初始化)图表 + - `creatChart` 方法,根据参数设置生成 data 上的 chart 对象 + - `resize` 方法 + +在图表组件中使用这个 mixin 示例 + +``` vue + + + +``` + +上面的代码段展示了如何使用 mixin 快速制作一个图表组件,只需根据某个图表的个性化需要,在组件中重新定义 `init` 和 `changeData` 方法即可 + +你可以修改这个 mixin 去实现更多的功能,同时影响所有的图表组件 + +::: tip +这只仅仅是作者个人对于图表封装的一个实现思路 +::: + +## 为什么没有选择其他产品 + +G2 完全可以胜任一般的后台界面报表图表需求,而且官网文档清晰友好 + +如果你需要更酷炫的图表,也完全可以剔除集成的库,换用 百度的[echarts](http://echarts.baidu.com/) 或者超级强大的 [d3.js](https://d3js.org/) \ No newline at end of file diff --git a/docs/zh/components/container.md b/docs/zh/components/container.md new file mode 100644 index 00000000..54190e06 --- /dev/null +++ b/docs/zh/components/container.md @@ -0,0 +1,89 @@ +# 页面容器 + +页面容器组件是每个页面的基础,为了在整个项目中统一效果,它应该是 `