diff --git a/.babelrc b/.babelrc
index c72eeb3a2..e3a543196 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,12 +1,9 @@
{
- "presets": [
- [
- "es2015",
- { "modules": false }
- ]
- ],
- "plugins": [
- "transform-runtime",
- "transform-vue-jsx"
- ]
-}
\ No newline at end of file
+ "presets": [["env", { "modules": false, "loose": true }]],
+ "plugins": ["transform-vue-jsx", "transform-runtime", "transform-object-rest-spread"],
+ "env": {
+ "commonjs": {
+ "presets": [["env", { "modules": "commonjs", "loose": true }]]
+ }
+ }
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/build/bin/build-all.js b/build/bin/build-all.js
deleted file mode 100644
index 565edeee2..000000000
--- a/build/bin/build-all.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-
-const components = require('../../components.json');
-const execSync = require('child_process').execSync;
-const existsSync = require('fs').existsSync;
-const path = require('path');
-
-const componentPaths = [];
-
-delete components.font;
-
-Object.keys(components).forEach(key => {
- const filePath = path.join(__dirname, `../../packages/${key}/webpack.conf.js`);
-
- if (existsSync(filePath)) {
- componentPaths.push(`packages/${key}/webpack.conf.js`);
- }
-});
-
-const paths = componentPaths.join(',');
-const cli = `node_modules/.bin/webpack build -c ${paths} -p`;
-
-execSync(cli, {
- stdio: 'inherit'
-});
diff --git a/build/bin/build-components.js b/build/bin/build-components.js
new file mode 100644
index 000000000..84a81f81c
--- /dev/null
+++ b/build/bin/build-components.js
@@ -0,0 +1,52 @@
+/**
+ * 编译 components 到 lib 目录
+ */
+const fs = require('fs-extra');
+const path = require('path');
+const compiler = require('vue-sfc-compiler');
+const libDir = path.resolve(__dirname, '../../lib');
+const srcDir = path.resolve(__dirname, '../../packages');
+require('shelljs/global');
+
+// 清空 lib 目录
+fs.emptyDirSync(libDir);
+
+// 复制 packages
+fs.copySync(srcDir, libDir);
+
+// 编译所有 .vue 文件到 .js
+compileVueFiles(libDir);
+
+// babel 编译
+exec('cross-env BABEL_ENV=commonjs babel lib --out-dir lib');
+
+function compileVueFiles(dir) {
+ const files = fs.readdirSync(dir);
+
+ files.forEach(file => {
+ const absolutePath = path.resolve(dir, file);
+
+ // 移除 vant-css
+ if (file.indexOf('vant-css') !== -1) {
+ fs.removeSync(absolutePath);
+ }
+ // 遍历文件夹
+ else if (isDir(absolutePath)) {
+ return compileVueFiles(absolutePath);
+ }
+ // 编译 .vue 文件
+ else if (/\.vue$/.test(file)) {
+ const source = fs.readFileSync(absolutePath, 'utf-8');
+ fs.removeSync(absolutePath);
+
+ const outputVuePath = absolutePath + '.js';
+ const outputJsPath = absolutePath.replace('.vue', '.js');
+ const output = fs.existsSync(outputJsPath) ? outputVuePath : outputJsPath;
+ fs.outputFileSync(output, compiler(source));
+ }
+ });
+}
+
+function isDir(dir) {
+ return fs.lstatSync(dir).isDirectory();
+}
diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js
index db939e763..6294590f1 100644
--- a/build/bin/build-entry.js
+++ b/build/bin/build-entry.js
@@ -4,8 +4,8 @@ var render = require('json-templater/string');
var uppercamelcase = require('uppercamelcase');
var path = require('path');
-var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
-var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
+var OUTPUT_PATH = path.join(__dirname, '../../packages/index.js');
+var IMPORT_TEMPLATE = 'import {{name}} from \'./{{package}}\';';
var ISNTALL_COMPONENT_TEMPLATE = ' {{name}}';
var MAIN_TEMPLATE = `{{include}}
diff --git a/build/bin/build-lib.js b/build/bin/build-lib.js
index 08155459a..0f59e218f 100644
--- a/build/bin/build-lib.js
+++ b/build/bin/build-lib.js
@@ -3,11 +3,11 @@
* Steps:
* 1. 清理目录
* 2. 构建 JS 入口文件
- * 3. 打包 JS 文件:vant.js && vant.min.js
- * 4. 构建 CSS 文件:vant-css
- * 5. 构建每个组件对应的 [component].js
+ * 3. 代码格式校验
+ * 4. 构建每个组件对应的 [component].js
+ * 5. 构建 vant-css
* 6. 生成每个组件目录下的 style 入口
- * 7. 编译 utils
+ * 7. 打包 JS 文件:vant.js && vant.min.js
*/
const fs = require('fs');
@@ -16,37 +16,27 @@ const components = require('../../components.json');
const chalk = require('chalk');
require('shelljs/global');
-// clean dir
-log('Starting', 'clean');
-exec('npm run clean --silent');
-log('Finished', 'clean');
-
-// build entry
-log('Starting', 'build:entry');
-exec('npm run build:file --silent');
-log('Finished', 'build:entry');
-
-// lint
+// 1. lint
log('Starting', 'lint');
exec('npm run lint --silent');
log('Finished', 'lint');
-// build vant.js
-log('Starting', 'build:vant');
-exec('npm run build:vant --silent');
-log('Finished', 'build:vant');
+// 2. build entry
+log('Starting', 'build:entry');
+exec('npm run build:file --silent');
+log('Finished', 'build:entry');
-// build [component].js
+// 3. build [component].js
log('Starting', 'build:component');
exec('npm run build:components --silent');
log('Finished', 'build:component');
-// build vant-css
+// 4. build vant-css
log('Starting', 'build:vant-css');
exec('npm run build:vant-css --silent');
log('Finished', 'build:vant-css');
-// build style entrys
+// 5. build style entrys
log('Starting', 'build:style-entries');
Object.keys(components).forEach((componentName) => {
const dir = path.join(__dirname, '../../lib/', componentName, '/style');
@@ -61,10 +51,10 @@ Object.keys(components).forEach((componentName) => {
});
log('Finished', 'build:style-entries');
-// build utils
-log('Starting', 'build:utils');
-exec('npm run build:utils --silent');
-log('Finished', 'build:utils');
+// 6. build vant.js
+log('Starting', 'build:vant');
+exec('npm run build:vant --silent');
+log('Finished', 'build:vant');
// helpers
function log(status, action, breakLine) {
diff --git a/build/webpack.build.js b/build/webpack.build.js
index 0ce2bb610..2b53cbae7 100644
--- a/build/webpack.build.js
+++ b/build/webpack.build.js
@@ -3,7 +3,7 @@ const config = require('./webpack.config.dev.js');
const isMinify = process.argv.indexOf('-p') !== -1;
config.entry = {
- 'vant': './src/index.js'
+ 'vant': './packages/index.js'
};
config.output = {
diff --git a/build/webpack.components.js b/build/webpack.components.js
deleted file mode 100644
index d5a3c18fb..000000000
--- a/build/webpack.components.js
+++ /dev/null
@@ -1,31 +0,0 @@
-const path = require('path');
-const Components = require('../components.json');
-const config = require('./webpack.build.js');
-const webpack = require('webpack');
-
-delete config.devtool;
-
-const entry = {};
-Object.keys(Components).forEach(key => {
- entry[key + '/index'] = Components[key];
-});
-
-config.entry = entry;
-
-config.externals = {
- vue: {
- root: 'Vue',
- commonjs: 'vue',
- commonjs2: 'vue',
- amd: 'vue'
- }
-};
-
-config.output = {
- path: path.join(__dirname, '../lib'),
- filename: '[name].js',
- libraryExport: "default",
- libraryTarget: 'umd'
-};
-
-module.exports = config;
diff --git a/build/webpack.config.dev.js b/build/webpack.config.dev.js
index 89ae7be1f..737712be8 100644
--- a/build/webpack.config.dev.js
+++ b/build/webpack.config.dev.js
@@ -38,7 +38,6 @@ module.exports = {
extensions: ['.js', '.vue', '.css'],
alias: {
vue: 'vue/dist/vue.runtime.esm.js',
- src: path.join(__dirname, '../src'),
packages: path.join(__dirname, '../packages'),
lib: path.join(__dirname, '../lib'),
components: path.join(__dirname, '../docs/src/components')
@@ -68,7 +67,7 @@ module.exports = {
},
{
test: /\.js$/,
- exclude: /node_modules|vue-router\/|vue-loader\/|vue-hot-reload-api\//,
+ exclude: /node_modules|vue-router\/|vue-loader\//,
loader: 'babel-loader'
},
{
diff --git a/docs/examples-docs/actionsheet.md b/docs/examples-docs/actionsheet.md
index bb7a56f26..09cd0fef6 100644
--- a/docs/examples-docs/actionsheet.md
+++ b/docs/examples-docs/actionsheet.md
@@ -53,7 +53,14 @@ export default {
}
-## ActionSheet 行动按钮
+## Actionsheet 行动按钮
+
+### 使用指南
+``` javascript
+import { Actionsheet } from 'vant';
+
+Vue.component(Actionsheet.name, Actionsheet);
+```
### 代码演示
@@ -106,11 +113,11 @@ export default {
```
:::
-#### 带取消按钮的ActionSheet
+#### 带取消按钮的 Actionsheet
-如果传入了`cancelText`属性,且不为空,则会在下方显示一个取消按钮,点击会将当前`ActionSheet`关闭。
+如果传入了`cancelText`属性,且不为空,则会在下方显示一个取消按钮,点击会将当前`Actionsheet`关闭。
-:::demo 带取消按钮的ActionSheet
+:::demo 带取消按钮的 Actionsheet
```html
弹出带取消按钮的actionsheet
@@ -149,11 +156,11 @@ export default {
```
:::
-#### 带标题的ActionSheet
+#### 带标题的 Actionsheet
-如果传入了`title`属性,且不为空,则另外一种样式的`ActionSheet`,里面内容需要自定义。
+如果传入了`title`属性,且不为空,则另外一种样式的`Actionsheet`,里面内容需要自定义。
-:::demo 带标题的ActionSheet
+:::demo 带标题的 Actionsheet
```html
弹出带标题的actionsheet
@@ -170,10 +177,11 @@ export default {
| title | 标题 | `String` | | |
| cancelText | 取消按钮文案 | `String` | | |
| overlay | 是否显示遮罩 | `Boolean` | | |
-| closeOnClickOverlay | 点击遮罩是否关闭`ActionSheet` | `Boolean` | | |
+| closeOnClickOverlay | 点击遮罩是否关闭`Actionsheet` | `Boolean` | | |
### actions
+
`API`中的`actions`为一个对象数组,数组中的每一个对象配置每一列,每一列有以下`key`:
| key | 说明 |
diff --git a/docs/examples-docs/badge.md b/docs/examples-docs/badge.md
index d8cec30bc..b0f27058c 100644
--- a/docs/examples-docs/badge.md
+++ b/docs/examples-docs/badge.md
@@ -28,6 +28,13 @@
## Badge 徽章
+### 使用指南
+``` javascript
+import { Badge } from 'vant';
+
+Vue.component(Badge.name, Badge);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/button.md b/docs/examples-docs/button.md
index fc4f506b5..992cc5ccc 100644
--- a/docs/examples-docs/button.md
+++ b/docs/examples-docs/button.md
@@ -1,126 +1,96 @@
## Button 按钮
+### 使用指南
+``` javascript
+import { Button } from 'vant';
+
+Vue.component(Button.name, Button);
+```
+
### 代码演示
-#### 按钮功能
+#### 按钮类型
-只接受`primary`, `default`, `danger`三种类型,默认`default`。
+支持`default`、`primary`、`danger`三种类型,默认为`default`
-:::demo 按钮功能
+:::demo 按钮类型
```html
-
-
- default
-
-
- primary
-
-
- danger
-
-
-```
-:::
-
-#### 禁用状态
-
-在组件上加上`disabled`属性即可,此时按钮不可点击。
-
-:::demo 禁用状态
-```html
-
-
- diabled
-
-
+Default
+Primary
+Danger
```
:::
#### 按钮尺寸
-只接受`large`, `normal`, `small`, `mini`四种尺寸,默认`normal`。`large`按钮默认100%宽度。
+支持`large`、`normal`、`small`、`mini`四种尺寸,默认为`normal`
:::demo 按钮尺寸
```html
-
-
- large
-
-
- normal
-
-
- small
-
-
- mini
-
-
+Large
+Normal
+Small
+Mini
+```
+:::
+
+#### 禁用状态
+
+通过`disabled`属性来禁用按钮,此时按钮不可点击
+
+:::demo 禁用状态
+```html
+Diabled
+```
+:::
+
+#### 加载状态
+
+:::demo 加载状态
+```html
+
```
:::
#### 自定义按钮标签
-按钮默认是`button`标签,可以使用`tag`属性修改为一个`a`标签。
+按钮标签默认为`button`,可以使用`tag`属性来修改按钮标签
:::demo 自定义按钮标签
```html
-
-
- a标签按钮
-
-
-```
-:::
-
-#### loading按钮
-
-`loading`状态的按钮。
-
-:::demo loading按钮
-```html
-
-
- loading
-
-
-
-
-
+
+ a 标签按钮
+
```
:::
#### 页面底部操作按钮
-一般用于`fixed`在底部的区域或是`popup`弹层的底部,一般只使用`primary`和`normal`两种状态。
-
:::demo 页面底部操作按钮
```html
-
-
- 立即购买
-
-
+立即购买
+
加入购物车
@@ -136,10 +106,11 @@
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
-| type | 按钮类型 | `string` | `default` | `primary`, `danger` |
-| size | 按钮尺寸 | `string` | `normal` | `large`, `small`, `mini` |
-| tag | 按钮标签 | `string` | `button` | 任何有意义的`html`标签, 如`a`, `span`等 |
-| diabled | 按钮是否禁用 | `boolean` | `false` | |
-| block | 按钮是否显示为块级元素 | `boolean` | `false` | |
-| bottomAction | 按钮是否显示为底部行动按钮,一般显示在页面底部,有特殊样式 | `boolean` | `false` | |
-
+| type | 按钮类型 | `String` | `default` | `primary` `danger` |
+| size | 按钮尺寸 | `String` | `normal` | `large` `small` `mini` |
+| tag | 按钮标签 | `String` | `button` | 任意`HTML`标签 |
+| nativeType | 按钮类型(原生) | `String` | `''` | |
+| diabled | 是否禁用 | `Boolean` | `false` | |
+| loading | 是否显示为加载状态 | `Boolean` | `false` | |
+| block | 是否为块级元素 | `Boolean` | `false` | |
+| bottomAction | 是否为底部行动按钮 | `Boolean` | `false` | |
diff --git a/docs/examples-docs/card.md b/docs/examples-docs/card.md
index 79d1704db..993c39f6d 100644
--- a/docs/examples-docs/card.md
+++ b/docs/examples-docs/card.md
@@ -1,5 +1,12 @@
## Card 图文组件
+### 使用指南
+``` javascript
+import { Card } from 'vant';
+
+Vue.component(Card.name, Card);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/cell-swipe.md b/docs/examples-docs/cell-swipe.md
index 4be8e7d11..45225aabd 100644
--- a/docs/examples-docs/cell-swipe.md
+++ b/docs/examples-docs/cell-swipe.md
@@ -22,6 +22,13 @@
## CellSwipe 滑动单元格
+### 使用指南
+``` javascript
+import { CellSwipe } from 'vant';
+
+Vue.component(CellSwipe.name, CellSwipe);
+```
+
### 代码演示
#### 基础用法
@@ -32,13 +39,8 @@
-
-
- 删除
-
-
- 选择
-
+ 删除
+ 选择
```
:::
@@ -48,13 +50,13 @@
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
-| right-width | 右侧滑动按钮宽度 | `number` | 0 | |
-| left-width | 左侧滑动按钮宽度 | `number` | 0 | |
+| left-width | 左侧滑动按钮宽度 | `number` | 0 | |
+| right-width | 右侧滑动按钮宽度 | `number` | 0 | |
### Slot
| name | 描述 |
|-----------|-----------|
| - | 自定义显示内容 |
-| right | 右侧滑动内容 |
| left | 左侧滑动内容 |
+| right | 右侧滑动内容 |
diff --git a/docs/examples-docs/cell.md b/docs/examples-docs/cell.md
index f3c9c3ffc..b2566b15a 100644
--- a/docs/examples-docs/cell.md
+++ b/docs/examples-docs/cell.md
@@ -10,6 +10,14 @@ export default {
## Cell 单元格
+### 使用指南
+``` javascript
+import { Cell, CellGroup } from 'vant';
+
+Vue.component(Cell.name, Cell);
+Vue.component(CellGroup.name, CellGroup);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/changelog.md b/docs/examples-docs/changelog.md
index 3255b8fc7..368905d3f 100644
--- a/docs/examples-docs/changelog.md
+++ b/docs/examples-docs/changelog.md
@@ -1,12 +1,51 @@
## 更新日志
+## [v0.8.4](https://github.com/youzan/vant/tree/v0.8.4) (2017-08-18)
+[Full Changelog](https://github.com/youzan/vant/compare/v0.8.3...v0.8.4)
+
+**合并的 Pull Request (可能有不兼容改动):**
+
+- fix: field 计算autosize,需要nextTick [\#78](https://github.com/youzan/vant/pull/78) ([pangxie1991](https://github.com/pangxie1991))
+
+## [v0.8.3](https://github.com/youzan/vant/tree/v0.8.3) (2017-08-18)
+[Full Changelog](https://github.com/youzan/vant/compare/v0.8.1...v0.8.3)
+
+**修复:**
+
+- fix: dialog wrong z-index [\#77](https://github.com/youzan/vant/pull/77) ([chenjiahan](https://github.com/chenjiahan))
+
+## [v0.8.1](https://github.com/youzan/vant/tree/v0.8.1) (2017-08-18)
+[Full Changelog](https://github.com/youzan/vant/compare/v0.8.0...v0.8.1)
+
+**非兼容更新和新特性:**
+
+- field 增加icon slot支持 [\#76](https://github.com/youzan/vant/pull/76) ([pangxie1991](https://github.com/pangxie1991))
+
+## [v0.8.0](https://github.com/youzan/vant/tree/v0.8.0) (2017-08-17)
+[Full Changelog](https://github.com/youzan/vant/compare/v0.7.10...v0.8.0)
+
+**非兼容更新和新特性:**
+
+- Optimize component building, reduce dist file size [\#74](https://github.com/youzan/vant/pull/74) ([chenjiahan](https://github.com/chenjiahan))
+
+## [v0.7.10](https://github.com/youzan/vant/tree/v0.7.10) (2017-08-16)
+[Full Changelog](https://github.com/youzan/vant/compare/v0.7.8...v0.7.10)
+
+**修复:**
+
+- fix: 修复popup和dialog同时出现时,几率出现dialog被挡住的情况 [\#75](https://github.com/youzan/vant/pull/75) ([pangxie1991](https://github.com/pangxie1991))
+- 修复:popup滚动穿透 [\#73](https://github.com/youzan/vant/pull/73) ([cookfront](https://github.com/cookfront))
+
## [v0.7.8](https://github.com/youzan/vant/tree/v0.7.8) (2017-08-10)
[Full Changelog](https://github.com/youzan/vant/compare/v0.7.7...v0.7.8)
-**合并的 Pull Request (可能有不兼容改动):**
+**非兼容更新和新特性:**
+
+- 补充 babel-plugin-import 文档 [\#71](https://github.com/youzan/vant/pull/71) ([chenjiahan](https://github.com/chenjiahan))
+
+**修复:**
- not require reset.css by default [\#72](https://github.com/youzan/vant/pull/72) ([chenjiahan](https://github.com/chenjiahan))
-- 补充 babel-plugin-import 文档 [\#71](https://github.com/youzan/vant/pull/71) ([chenjiahan](https://github.com/chenjiahan))
## [v0.7.7](https://github.com/youzan/vant/tree/v0.7.7) (2017-08-09)
[Full Changelog](https://github.com/youzan/vant/compare/v0.7.6...v0.7.7)
diff --git a/docs/examples-docs/checkbox.md b/docs/examples-docs/checkbox.md
index eb7770e30..fdfcba1d7 100644
--- a/docs/examples-docs/checkbox.md
+++ b/docs/examples-docs/checkbox.md
@@ -35,6 +35,13 @@ export default {
## Checkbox 复选框
+### 使用指南
+``` javascript
+import { Checkbox } from 'vant';
+
+Vue.component(Checkbox.name, Checkbox);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/datetime-picker.md b/docs/examples-docs/datetime-picker.md
index 1d90f56c3..3f122139d 100644
--- a/docs/examples-docs/datetime-picker.md
+++ b/docs/examples-docs/datetime-picker.md
@@ -25,7 +25,14 @@ export default {
};
-## Datetime Picker 时间选择
+## DatetimePicker 时间选择
+
+### 使用指南
+``` javascript
+import { DatetimePicker } from 'vant';
+
+Vue.component(DatetimePicker.name, DatetimePicker);
+```
### 代码演示
diff --git a/docs/examples-docs/dialog.md b/docs/examples-docs/dialog.md
index 8fbcca762..a40704c8c 100644
--- a/docs/examples-docs/dialog.md
+++ b/docs/examples-docs/dialog.md
@@ -7,7 +7,7 @@
+
## Icon 图标
+### 使用指南
+``` javascript
+import { Icon } from 'vant';
+
+Vue.component(Icon.name, Icon);
+```
+
### 代码演示
#### 基础用法
@@ -27,318 +61,89 @@
:::demo 基础用法
```html
-
+
```
:::
-#### 所有Icons
-
-以下目前有的所有图标及其名称:
+#### 图标列表
:::demo 所有Icon
```html
-
-
-
- qr-invalid
-
-
-
- qr
-
-
-
- exchange
-
-
-
- close
-
-
-
- location
-
-
-
- upgrade
-
-
-
- check
-
-
-
- checked
-
-
-
- like-o
-
-
-
- like
-
-
-
- chat
-
-
-
- shop
-
-
-
- photograph
-
-
-
- add
-
-
-
- add2
-
-
-
- photo
-
-
-
- edit
-
-
-
- passed
-
-
-
- cart
-
-
-
- arrow
-
-
-
- gift
-
-
-
- search
-
-
-
- clear
-
-
-
- success
-
-
-
- fail
-
-
-
- contact
-
-
-
- wechat
-
-
-
- alipay
-
-
-
- password-view
-
-
-
- wap-nav
-
-
-
- password-not-view
-
-
-
- wap-home
-
-
-
- ecard-pay
-
-
-
- balance-pay
-
-
-
- peer-pay
-
-
-
- credit-pay
-
-
-
- debit-pay
-
-
-
- other-pay
-
-
-
- cart
-
-
-
- browsing-history
-
-
-
- goods-collect
-
-
-
- shop-collect
-
-
-
- receive-gift
-
-
-
- send-gift
-
-
-
- setting
-
-
-
- points
-
-
-
- coupon
-
-
-
- free-postage
-
-
-
- discount
-
-
-
- birthday-privilege
-
-
-
- member-day-privilege
-
-
-
- balance-details
-
-
-
- cash-back-record
-
-
-
- points-mall
-
-
-
- exchange-record
-
-
-
- pending-payment
-
-
-
- pending-orders
-
-
-
- pending-deliver
-
-
-
- logistics
-
-
-
- pending-evaluate
-
-
-
- cash-on-deliver
-
-
-
- gift-card-pay
-
-
-
- underway
-
-
-
- point-gift
-
-
-
- after-sale
-
-
-
- edit-data
-
-
-
- question
-
-
-
- delete
-
-
-
- records
-
-
-
- description
-
-
-
- card
-
-
-
- gift-card
-
-
-
- coupon
-
-
-
- clock
-
-
-
- gold-coin
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```
:::
diff --git a/docs/examples-docs/image-preview.md b/docs/examples-docs/image-preview.md
index 010136045..1239abd78 100644
--- a/docs/examples-docs/image-preview.md
+++ b/docs/examples-docs/image-preview.md
@@ -7,7 +7,7 @@
+```
+:::
+
#### 自动轮播
需要设置`auto-play`属性为`true`,即会自动轮播。
diff --git a/docs/examples-docs/switch.md b/docs/examples-docs/switch.md
index 40500b81f..cb02b9ec8 100644
--- a/docs/examples-docs/switch.md
+++ b/docs/examples-docs/switch.md
@@ -43,6 +43,13 @@ export default {
## Switch 开关
+### 使用指南
+``` javascript
+import { Switch } from 'vant';
+
+Vue.component(Switch.name, Switch);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/tab.md b/docs/examples-docs/tab.md
index 5e4af3cbe..4c2d7486e 100644
--- a/docs/examples-docs/tab.md
+++ b/docs/examples-docs/tab.md
@@ -49,6 +49,14 @@ export default {
## Tab 标签
+### 使用指南
+``` javascript
+import { Tab, Tabs } from 'vant';
+
+Vue.component(Tab.name, Tab);
+Vue.component(Tabs.name, Tabs);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/tag.md b/docs/examples-docs/tag.md
index 5dd8f00d2..4d21b6ba6 100644
--- a/docs/examples-docs/tag.md
+++ b/docs/examples-docs/tag.md
@@ -10,6 +10,13 @@
## Tag 标记
+### 使用指南
+``` javascript
+import { Tag } from 'vant';
+
+Vue.component(Tag.name, Tag);
+```
+
### 代码演示
#### 基础用法
diff --git a/docs/examples-docs/toast.md b/docs/examples-docs/toast.md
index c36cbdfc6..aed09019c 100644
--- a/docs/examples-docs/toast.md
+++ b/docs/examples-docs/toast.md
@@ -7,7 +7,7 @@