From 45e134fa7ec4b50d5a430b797c852f652eae0697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 20 Oct 2017 11:22:22 +0800 Subject: [PATCH] [Doc]: add CDN link --- README.md | 39 ++------------------------ README.zh-CN.md | 39 ++------------------------ docs/examples-docs/en-US/quickstart.md | 10 +++++++ docs/examples-docs/zh-CN/quickstart.md | 10 +++++++ docs/src/doc.config.js | 4 +-- 5 files changed, 26 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index 3addf5d17..68fa8e9b2 100644 --- a/README.md +++ b/README.md @@ -17,43 +17,8 @@ npm i -S vant ``` -## Usage - -### Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended) - - ```js - // .babelrc or babel-loader option - { - "plugins": [ - ["import", { "libraryName": "vant", "style": true }] - ] - } - ``` - - Then you can import components from vant, equivalent to import manually below. - - ```js - // import js and css modularly, parsed by babel-plugin-import - import { Button } from 'vant'; - ``` - -### Manually import - - ```jsx - import { Button } from 'vant'; - import 'vant/lib/vant-css/button.css'; - ``` - - -### Import all components - -```javascript -import Vue from 'vue'; -import vant from 'vant'; -import 'vant/lib/vant-css/index.css'; - -Vue.use(vant); -``` +## Quickstart +See [Quickstart](https://www.youzanyun.com/zanui/vue#/en-US/component/quickstart). ## How to contribute diff --git a/README.zh-CN.md b/README.zh-CN.md index 0ff69a162..0df28304e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -15,43 +15,8 @@ npm i -S vant ``` -## 二、使用 - - -### 使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (推荐) - - ```js - // .babelrc or babel-loader option - { - "plugins": [ - ["import", { "libraryName": "vant", "style": true }] - ] - } - ``` - -   接着你可以直接引入 vant 组件,等价于下方的按需引入组件 - - ```js -   // 模块化地引入 js 和 css, 通过 babel-plugin-import 插件解析 -   import { Button } from 'vant'; - ``` - -### 按需引入组件 - - ```jsx - import { Button } from 'vant/lib/button'; - import 'vant/lib/vant-css/button.css'; - ``` - -### 导入所有组件 - -```javascript -import Vue from 'vue'; -import vant from 'vant'; -import 'vant/lib/vant-css/index.css'; - -Vue.use(vant); -``` +## 二、快速上手 +参考 [Quickstart](https://www.youzanyun.com/zanui/vue#/zh-CN/component/quickstart). ## 三、贡献代码 diff --git a/docs/examples-docs/en-US/quickstart.md b/docs/examples-docs/en-US/quickstart.md index f11e3b68e..50e602821 100644 --- a/docs/examples-docs/en-US/quickstart.md +++ b/docs/examples-docs/en-US/quickstart.md @@ -47,3 +47,13 @@ import 'vant/lib/vant-css/index.css'; Vue.use(Vant); ``` + +### CDN + +```html + + + + + +``` diff --git a/docs/examples-docs/zh-CN/quickstart.md b/docs/examples-docs/zh-CN/quickstart.md index 2e42a168b..04395c350 100644 --- a/docs/examples-docs/zh-CN/quickstart.md +++ b/docs/examples-docs/zh-CN/quickstart.md @@ -48,6 +48,16 @@ import 'vant/lib/vant-css/index.css'; Vue.use(Vant); ``` +### CDN + +```html + + + + + +``` + ### 自定义主题 `Vant`提供了一套默认主题,CSS 命名采用 BEM 的风格,方便使用者覆盖样式。如果你想完全替换主题色或者部分样式,可以使用下面的方法: diff --git a/docs/src/doc.config.js b/docs/src/doc.config.js index a52174038..4bb19a109 100644 --- a/docs/src/doc.config.js +++ b/docs/src/doc.config.js @@ -12,7 +12,7 @@ module.exports = { 微信小程序: 'https://github.com/youzan/zanui-weapp', 意见反馈: 'https://github.com/youzan/vant/issues', 开发指南: - 'https://github.com/youzan/vant/blob/dev/docs/examples-docs/zh-CN/contribute.md' + 'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.zh-CN.md' } }, nav: [ @@ -268,7 +268,7 @@ module.exports = { Weapp: 'https://github.com/youzan/zanui-weapp', Feedback: 'https://github.com/youzan/vant/issues', Contribute: - 'https://github.com/youzan/vant/blob/dev/docs/examples-docs/en-US/contribute.md' + 'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md' } }, nav: [