From 02a8c2a592e26ced6deb4ad8f3090aa481b25911 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 19 Dec 2017 13:08:09 +0800 Subject: [PATCH] [Doc] add introduction page (#452) --- README.md | 49 +++++++++++++++++-------------- README.zh-CN.md | 4 +-- docs/markdown/en-US/i18n.md | 2 +- docs/markdown/en-US/intro.md | 38 ++++++++++++++++++++++++ docs/markdown/index.js | 2 ++ docs/markdown/zh-CN/i18n.md | 2 +- docs/markdown/zh-CN/intro.md | 40 +++++++++++++++++++++++++ docs/markdown/zh-CN/quickstart.md | 4 +-- docs/src/DocsApp.vue | 30 +++++++++++++++++++ docs/src/doc.config.js | 10 +++++++ docs/src/router.config.js | 2 +- package.json | 4 +-- yarn.lock | 12 ++++---- 13 files changed, 161 insertions(+), 38 deletions(-) create mode 100644 docs/markdown/en-US/intro.md create mode 100644 docs/markdown/zh-CN/intro.md diff --git a/README.md b/README.md index 95048b154..60f725bf3 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@

- logo + logo

- logo + logo

A Vue.js 2.0 Mobile UI at YouZan

-[![Build Status](https://travis-ci.org/youzan/vant.svg?branch=master)](https://travis-ci.org/youzan/vant) -[![downloads](https://img.shields.io/npm/dt/vant.svg)](https://www.npmjs.com/package/vant) +[![Build Status](https://travis-ci.org/youzan/vant.svg?branch=master)](https://travis-ci.org/youzan/vant) +[![downloads](https://img.shields.io/npm/dt/vant.svg)](https://www.npmjs.com/package/vant) [![Coverage Status](https://img.shields.io/codecov/c/github/youzan/vant/dev.svg)](https://codecov.io/github/youzan/vant?branch=dev) -[![npm version](https://img.shields.io/npm/v/vant.svg?style=flat)](https://www.npmjs.com/package/vant) +[![npm version](https://img.shields.io/npm/v/vant.svg?style=flat)](https://www.npmjs.com/package/vant) [![license](https://img.shields.io/npm/l/vant.svg)](https://www.npmjs.com/package/vant) - + [访问中文版](./README.zh-CN.md) ## Features -- 45+ Reusable components -- 90%+ Unit test coverage -- Extensive documentation and demos -- Support [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) -- Support TypeScript -- Support SSR +* 48+ Reusable components +* 90%+ Unit test coverage +* Extensive documentation and demos +* Support [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) +* Support TypeScript +* Support SSR

components preview @@ -34,10 +34,11 @@ ```shell npm i -S vant ``` - + ## Quickstart #### 1. Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended) + ```bash # Install babel-plugin-import npm i babel-plugin-import -D @@ -65,7 +66,7 @@ import { Button } from 'vant/lib/button'; import 'vant/lib/vant-css/base.css'; import 'vant/lib/vant-css/button.css'; ``` - + #### 3. Import all components ```js @@ -87,25 +88,29 @@ Vue.use(Vant); ``` See more in [Quickstart](https://www.youzanyun.com/zanui/vant#/en-US/component/quickstart). - + ## Contribution + Please make sure to read the [Contributing Guide](./.github/CONTRIBUTING.md) before making a pull request. ## Browser Support + Modern browsers and Android 4.0+, iOS 6+. ## Links -- [Documentation](https://www.youzanyun.com/zanui/vant) -- [Changelog](https://www.youzanyun.com/zanui/vant#/en-US/component/changelog) -- [Weapp UI](https://github.com/youzan/zanui-weapp) -- [Vant Demo](https://github.com/youzan/vant-demo) -- [vue-cli-template-vant](https://github.com/youzan/vue-cli-template-vant) - + +* [Documentation](https://www.youzanyun.com/zanui/vant) +* [Changelog](https://www.youzanyun.com/zanui/vant#/en-US/component/changelog) +* [Weapp UI](https://github.com/youzan/zanui-weapp) +* [Vant Demo](https://github.com/youzan/vant-demo) +* [vue-cli-template-vant](https://github.com/youzan/vue-cli-template-vant) + ## Preview + You can scan the following QR code to access the demo: ![qrcode](https://img.yzcdn.cn/v2/image/youzanyun/zanui/pc/zanui_vue_mobile_preview_03.png) - + ## LICENSE [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) diff --git a/README.zh-CN.md b/README.zh-CN.md index 1be4d94e6..755bdb760 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -15,7 +15,7 @@ ## 特性 -- 48 个经过有赞线上业务检验的组件 +- 48+ 个经过有赞线上业务检验的组件 - 单元测试覆盖率超过90% - 完善的文档和示例 - 支持 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) @@ -102,7 +102,7 @@ Vue.use(Vant); ## 链接 - [详细文档](https://www.youzanyun.com/zanui/vant) -- [更新日志](https://www.youzanyun.com/zanui/vant#/en-US/component/changelog) +- [更新日志](https://www.youzanyun.com/zanui/vant#/zh-CN/component/changelog) - [微信小程序组件库](https://github.com/youzan/zanui-weapp) - [vant-demo](https://github.com/youzan/vant-demo) - [vue-cli-template-vant](https://github.com/youzan/vue-cli-template-vant) diff --git a/docs/markdown/en-US/i18n.md b/docs/markdown/en-US/i18n.md index 86203d925..134588fb1 100644 --- a/docs/markdown/en-US/i18n.md +++ b/docs/markdown/en-US/i18n.md @@ -1,4 +1,4 @@ -# Internationalization +## Internationalization The default language of Vant is Chinese. If you want to use other languages, you can follow the instructions below. ### Switch languages diff --git a/docs/markdown/en-US/intro.md b/docs/markdown/en-US/intro.md new file mode 100644 index 000000000..c9dd2ebe3 --- /dev/null +++ b/docs/markdown/en-US/intro.md @@ -0,0 +1,38 @@ +

+ + +

Vant

+

A Vue.js 2.0 Mobile UI at YouZan

+
+ +### Features + +* 48+ Reusable components +* 90%+ Unit test coverage +* Extensive documentation and demos +* Support [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) +* Support TypeScript +* Support SSR + +### Quickstart + +See in [Quickstart](https://www.youzanyun.com/zanui/vant#/en-US/component/quickstart). + +### Contribution + +Please make sure to read the [Contributing Guide](https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md) before making a pull request. + +### Browser Support + +Modern browsers and Android 4.0+, iOS 6+. + +### Links + +* [Changelog](https://www.youzanyun.com/zanui/vant#/en-US/component/changelog) +* [Weapp UI](https://github.com/youzan/zanui-weapp) +* [Vant Demo](https://github.com/youzan/vant-demo) +* [vue-cli-template-vant](https://github.com/youzan/vue-cli-template-vant) + +### LICENSE + +[MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) diff --git a/docs/markdown/index.js b/docs/markdown/index.js index 7d58dc28c..5ed13a8a4 100644 --- a/docs/markdown/index.js +++ b/docs/markdown/index.js @@ -35,6 +35,7 @@ export default { 'zh-CN/i18n': wrapper(r => require.ensure([], () => r(require('./zh-CN/i18n.md')), 'zh-CN/i18n')), 'zh-CN/icon': wrapper(r => require.ensure([], () => r(require('./zh-CN/icon.md')), 'zh-CN/icon')), 'zh-CN/image-preview': wrapper(r => require.ensure([], () => r(require('./zh-CN/image-preview.md')), 'zh-CN/image-preview')), + 'zh-CN/intro': wrapper(r => require.ensure([], () => r(require('./zh-CN/intro.md')), 'zh-CN/intro')), 'zh-CN/layout': wrapper(r => require.ensure([], () => r(require('./zh-CN/layout.md')), 'zh-CN/layout')), 'zh-CN/lazyload': wrapper(r => require.ensure([], () => r(require('./zh-CN/lazyload.md')), 'zh-CN/lazyload')), 'zh-CN/loading': wrapper(r => require.ensure([], () => r(require('./zh-CN/loading.md')), 'zh-CN/loading')), @@ -86,6 +87,7 @@ export default { 'en-US/i18n': wrapper(r => require.ensure([], () => r(require('./en-US/i18n.md')), 'en-US/i18n')), 'en-US/icon': wrapper(r => require.ensure([], () => r(require('./en-US/icon.md')), 'en-US/icon')), 'en-US/image-preview': wrapper(r => require.ensure([], () => r(require('./en-US/image-preview.md')), 'en-US/image-preview')), + 'en-US/intro': wrapper(r => require.ensure([], () => r(require('./en-US/intro.md')), 'en-US/intro')), 'en-US/layout': wrapper(r => require.ensure([], () => r(require('./en-US/layout.md')), 'en-US/layout')), 'en-US/lazyload': wrapper(r => require.ensure([], () => r(require('./en-US/lazyload.md')), 'en-US/lazyload')), 'en-US/loading': wrapper(r => require.ensure([], () => r(require('./en-US/loading.md')), 'en-US/loading')), diff --git a/docs/markdown/zh-CN/i18n.md b/docs/markdown/zh-CN/i18n.md index abca22380..60e744a49 100644 --- a/docs/markdown/zh-CN/i18n.md +++ b/docs/markdown/zh-CN/i18n.md @@ -1,4 +1,4 @@ -# 国际化 +## 国际化 Vant 默认采用中文作为语言,如果需要使用其他语言,可以参考下面的方案 ### 多语言切换 diff --git a/docs/markdown/zh-CN/intro.md b/docs/markdown/zh-CN/intro.md new file mode 100644 index 000000000..c8bbe639f --- /dev/null +++ b/docs/markdown/zh-CN/intro.md @@ -0,0 +1,40 @@ +
+ + +

Vant

+

有赞移动端 Vue 组件库

+
+ +### 特性 + +* 48+ 个经过有赞线上业务检验的组件 +* 单元测试覆盖率超过 90% +* 完善的文档和示例 +* 支持 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) +* 支持 TypeScript +* 支持 SSR + +### 快速上手 + +请参考 [快速上手](https://www.youzanyun.com/zanui/vant#/zh-CN/component/quickstart). + +### 贡献代码 + +修改代码请阅读我们的 [开发指南](https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.zh-CN.md)。 + +使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 + +### 浏览器支持 + +现代浏览器以及 Android 4.0+, iOS 6+. + +### 链接 + +* [更新日志](https://www.youzanyun.com/zanui/vant#/zh-CN/component/changelog) +* [微信小程序组件库](https://github.com/youzan/zanui-weapp) +* [vant-demo](https://github.com/youzan/vant-demo) +* [vue-cli-template-vant](https://github.com/youzan/vue-cli-template-vant) + +### 开源协议 + +本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。 diff --git a/docs/markdown/zh-CN/quickstart.md b/docs/markdown/zh-CN/quickstart.md index 6499f5fdb..66249ad64 100644 --- a/docs/markdown/zh-CN/quickstart.md +++ b/docs/markdown/zh-CN/quickstart.md @@ -1,6 +1,4 @@ -## Vant - -基于`Vue 2.0`的 Mobile 组件库 +## 快速上手 ### 安装 diff --git a/docs/src/DocsApp.vue b/docs/src/DocsApp.vue index 2033504c4..8ef1fef30 100644 --- a/docs/src/DocsApp.vue +++ b/docs/src/DocsApp.vue @@ -39,3 +39,33 @@ export default { } }; + + diff --git a/docs/src/doc.config.js b/docs/src/doc.config.js index 9036c34fa..65985511a 100644 --- a/docs/src/doc.config.js +++ b/docs/src/doc.config.js @@ -32,6 +32,11 @@ module.exports = { groups: [ { list: [ + { + path: '/intro', + title: '介绍', + noExample: true + }, { path: '/quickstart', title: '快速上手', @@ -315,6 +320,11 @@ module.exports = { groups: [ { list: [ + { + path: '/intro', + title: 'Introduction', + noExample: true + }, { path: '/quickstart', title: 'Getting Started', diff --git a/docs/src/router.config.js b/docs/src/router.config.js index feadf84af..dff971a7a 100644 --- a/docs/src/router.config.js +++ b/docs/src/router.config.js @@ -22,7 +22,7 @@ const registerRoute = (isExample) => { } else { route.push({ path: `/${lang}`, - redirect: `/${lang}/component/quickstart` + redirect: `/${lang}/component/intro` }); } diff --git a/package.json b/package.json index 4bddc9822..4b88b695c 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "dependency-tree": "^5.12.0", "eslint-plugin-vue": "^2.1.0", "extract-text-webpack-plugin": "3.0.2", - "fast-vue-md-loader": "^1.0.2", + "fast-vue-md-loader": "^1.0.3", "felint": "^0.5.0-alpha.3", "file-save": "^0.2.0", "friendly-errors-webpack-plugin": "^1.6.1", @@ -105,7 +105,7 @@ "run-sequence": "^2.1.0", "sinon": "^2.4.1", "sinon-chai": "^2.12.0", - "style-loader": "^0.19.0", + "style-loader": "^0.19.1", "uppercamelcase": "^3.0.0", "url-loader": "^0.6.2", "vant-doc": "0.3.19", diff --git a/yarn.lock b/yarn.lock index 884238346..7497ce6fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2774,9 +2774,9 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fast-vue-md-loader@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/fast-vue-md-loader/-/fast-vue-md-loader-1.0.2.tgz#afa849ba384723d3527b534477f5fcef0388306a" +fast-vue-md-loader@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fast-vue-md-loader/-/fast-vue-md-loader-1.0.3.tgz#ba1584bd1e2d012575cb2b3260d0c8fe4c1b7fa4" dependencies: highlight.js "^9.12.0" markdown-it "^8.4.0" @@ -7164,9 +7164,9 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -style-loader@^0.19.0: - version "0.19.0" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.0.tgz#7258e788f0fee6a42d710eaf7d6c2412a4c50759" +style-loader@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.1.tgz#591ffc80bcefe268b77c5d9ebc0505d772619f85" dependencies: loader-utils "^1.0.2" schema-utils "^0.3.0"