From 88bcdd6d6f2a37a592d8a0cc21db3b39cc6e624c Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sun, 3 Jun 2018 19:30:57 +0800 Subject: [PATCH] no message Former-commit-id: 9c99fa78c3e9d9453e748436f0145eb22284db16 Former-commit-id: 514ae0d6194941cd08584367b1970c2e610d99d5 Former-commit-id: beaede8116f4791cdf772b2848f849b04e1a6ee9 --- deploy.sh | 25 ++ docs/.vuepress/config.js | 93 ++++++++ docs/.vuepress/override.styl | 1 + .../public/logo@2x.png.REMOVED.git-id | 1 + docs/README.md | 29 +++ docs/zh/README.md | 25 ++ docs/zh/components/README.md | 3 + docs/zh/components/charts.md | 72 ++++++ docs/zh/components/container.md | 89 +++++++ docs/zh/components/count-up.md | 29 +++ docs/zh/components/highlight.md | 17 ++ docs/zh/components/icon-select.md | 12 + docs/zh/components/icon-svg.md | 34 +++ docs/zh/components/icon.md | 41 ++++ docs/zh/components/markdown.md | 60 +++++ docs/zh/guide/README.md | 151 ++++++++++++ docs/zh/guide/change-log.md | 13 ++ docs/zh/plugins/README.md | 3 + docs/zh/plugins/data-export.md | 148 ++++++++++++ docs/zh/plugins/data-import.md | 64 +++++ docs/zh/plugins/i18n.md | 124 ++++++++++ docs/zh/plugins/mock.md | 221 ++++++++++++++++++ docs/zh/plugins/timeago.md | 49 ++++ package.json | 5 +- 24 files changed, 1308 insertions(+), 1 deletion(-) create mode 100755 deploy.sh create mode 100644 docs/.vuepress/config.js create mode 100644 docs/.vuepress/override.styl create mode 100644 docs/.vuepress/public/logo@2x.png.REMOVED.git-id create mode 100644 docs/README.md create mode 100644 docs/zh/README.md create mode 100644 docs/zh/components/README.md create mode 100644 docs/zh/components/charts.md create mode 100644 docs/zh/components/container.md create mode 100644 docs/zh/components/count-up.md create mode 100644 docs/zh/components/highlight.md create mode 100644 docs/zh/components/icon-select.md create mode 100644 docs/zh/components/icon-svg.md create mode 100644 docs/zh/components/icon.md create mode 100644 docs/zh/components/markdown.md create mode 100644 docs/zh/guide/README.md create mode 100644 docs/zh/guide/change-log.md create mode 100644 docs/zh/plugins/README.md create mode 100644 docs/zh/plugins/data-export.md create mode 100644 docs/zh/plugins/data-import.md create mode 100644 docs/zh/plugins/i18n.md create mode 100644 docs/zh/plugins/mock.md create mode 100644 docs/zh/plugins/timeago.md diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000..4c4c1ee1 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +# 确保脚本抛出遇到的错误 +set -e + +# 生成静态文件 +npm run 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..929add7c --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,93 @@ +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: [ + '', + '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 @@ +# 页面容器 + +页面容器组件是每个页面的基础,为了在整个项目中统一效果,它应该是 `