From 53ff09b3bb60630845072052edae0390dada3e60 Mon Sep 17 00:00:00 2001 From: rex Date: Wed, 3 Apr 2019 20:15:05 +0800 Subject: [PATCH] [docs]: add es5 guide --- README.md | 4 ++-- docs/markdown/quickstart.md | 22 +++++++++++++++------- packages/action-sheet/README.md | 9 +++++++++ packages/area/README.md | 9 +++++++++ packages/badge/README.md | 10 ++++++++++ packages/button/README.md | 15 ++++++++++++--- packages/card/README.md | 9 +++++++++ packages/cell/README.md | 10 ++++++++++ packages/checkbox/README.md | 10 ++++++++++ packages/col/README.md | 12 +++++++++++- packages/collapse/README.md | 10 ++++++++++ packages/datetime-picker/README.md | 9 +++++++++ packages/dialog/README.md | 11 +++++++++++ packages/field/README.md | 9 +++++++++ packages/goods-action/README.md | 11 +++++++++++ packages/icon/README.md | 17 +++++++++-------- packages/loading/README.md | 15 +++++++++------ packages/nav-bar/README.md | 9 +++++++++ packages/notice-bar/README.md | 15 +++++++++------ packages/notify/README.md | 17 +++++++++++++---- packages/panel/README.md | 15 +++++++++------ packages/picker/README.md | 9 +++++++++ packages/popup/README.md | 10 ++++++++++ packages/progress/README.md | 15 +++++++++------ packages/radio/README.md | 16 ++++++++++------ packages/rate/README.md | 16 +++++++++------- packages/search/README.md | 18 +++++++++--------- packages/slider/README.md | 18 +++++++++++------- packages/stepper/README.md | 9 +++++++++ packages/steps/README.md | 9 +++++++++ packages/submit-bar/README.md | 9 +++++++++ packages/swipe-cell/README.md | 9 +++++++++ packages/switch-cell/README.md | 16 +++++++++------- packages/switch/README.md | 17 +++++++++-------- packages/tab/README.md | 10 ++++++++++ packages/tabbar/README.md | 14 ++++++++++++-- packages/tag/README.md | 9 +++++++++ packages/toast/README.md | 20 +++++++++++--------- packages/transition/README.md | 9 +++++++++ packages/tree-select/README.md | 15 +++++++++------ 40 files changed, 386 insertions(+), 110 deletions(-) diff --git a/README.md b/README.md index 9c99f8b7..c0aca199 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ git clone https://github.com/youzan/vant-weapp.git 接着就可以在 wxml 中直接使用组件 -```xml +```html 按钮 ``` @@ -85,7 +85,7 @@ Vant Weapp 最低支持到小程序基础库 1.9.9 版本 ## 迁移指南 Vant Weapp 是基于有赞 Zanui 组件库进行的品牌升级,对于仍在使用 Zanui 的用户,建议逐渐使用 Vant Weapp 替换原有的组件。 - + Zanui 后续会进入维护状态,仓库地址为:[https://github.com/youzan/zanui-weapp](https://github.com/youzan/zanui-weapp) ## 链接 diff --git a/docs/markdown/quickstart.md b/docs/markdown/quickstart.md index 2b23c7c2..d1b8e02b 100644 --- a/docs/markdown/quickstart.md +++ b/docs/markdown/quickstart.md @@ -20,7 +20,7 @@ yarn add vant-weapp --production #### 方式二. 下载代码 -直接通过 git 下载 Vant Weapp 源代码,并将`dist`目录拷贝到自己的项目中 +直接通过 git 下载 Vant Weapp 源代码,并将`dist`或`lib`目录拷贝到自己的项目中 ```bash git clone https://github.com/youzan/vant-weapp.git ``` @@ -29,11 +29,19 @@ git clone https://github.com/youzan/vant-weapp.git 以按钮组件为例,只需要在 json 文件中引入按钮对应的自定义组件即可 +某些小程序框架会要求关闭`ES6转ES5`选项,可以引入`lib`目录内es5版本的组件 + +es6 ```json -{ - "usingComponents": { - "van-button": "/path/to/vant-weapp/dist/button/index" - } +"usingComponents": { + "van-button": "/path/to/vant-weapp/dist/button/index" +} +``` + +es5 +```json +"usingComponents": { + "van-button": "/path/to/vant-weapp/lib/button/index" } ``` @@ -43,7 +51,7 @@ git clone https://github.com/youzan/vant-weapp.git 按钮 ``` -### 在开发者工具中预览 +### 在开发者工具中预览示例小程序 ```bash # 安装项目依赖 @@ -53,4 +61,4 @@ npm install npm run dev ``` -打开[微信开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html),把`vant-weapp/example`目录添加进去就可以预览示例了。 +打开[微信开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html),导入`example`目录的项目就可以预览示例了。 diff --git a/packages/action-sheet/README.md b/packages/action-sheet/README.md index 1767bad0..701aa54c 100644 --- a/packages/action-sheet/README.md +++ b/packages/action-sheet/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-action-sheet": "path/to/vant-weapp/dist/action-sheet/index" } ``` +es5 +```json +"usingComponents": { + "van-action-sheet": "path/to/vant-weapp/lib/action-sheet/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/area/README.md b/packages/area/README.md index 31b6bc59..eac7a246 100644 --- a/packages/area/README.md +++ b/packages/area/README.md @@ -4,12 +4,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-area": "path/to/vant-weapp/dist/area/index" } ``` +es5 +```json +"usingComponents": { + "van-area": "path/to/vant-weapp/lib/area/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/badge/README.md b/packages/badge/README.md index 35869cac..f3f395eb 100644 --- a/packages/badge/README.md +++ b/packages/badge/README.md @@ -2,6 +2,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-badge": "path/to/vant-weapp/dist/badge/index", @@ -9,6 +11,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-badge": "path/to/vant-weapp/lib/badge/index", + "van-badge-group": "path/to/vant-weapp/lib/badge-group/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/button/README.md b/packages/button/README.md index b3fe192c..4ecb058a 100644 --- a/packages/button/README.md +++ b/packages/button/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 json 文件中配置button组件 + +es6 ```json "usingComponents": { "van-button": "path/to/vant-weapp/dist/button/index" } ``` +es5 +```json +"usingComponents": { + "van-button": "path/to/vant-weapp/lib/button/index" +} +``` + ### 代码演示 #### 按钮类型 @@ -51,14 +60,14 @@ #### 加载状态 -```html +```html ``` #### 按钮形状 -```html +```html 方形按钮 圆形按钮 ``` @@ -66,7 +75,7 @@ #### 按钮尺寸 支持`large`、`normal`、`small`、`mini`四种尺寸,默认为`normal` -```html +```html 大号按钮 普通按钮 小型按钮 diff --git a/packages/card/README.md b/packages/card/README.md index 0c6cc1d6..d4c31f46 100644 --- a/packages/card/README.md +++ b/packages/card/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-card": "path/to/vant-weapp/dist/card/index" } ``` +es5 +```json +"usingComponents": { + "van-card": "path/to/vant-weapp/lib/card/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/cell/README.md b/packages/cell/README.md index f2be37a1..840af3e9 100644 --- a/packages/cell/README.md +++ b/packages/cell/README.md @@ -3,6 +3,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-cell": "path/to/vant-weapp/dist/cell/index", @@ -10,6 +12,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-cell": "path/to/vant-weapp/lib/cell/index", + "van-cell-group": "path/to/vant-weapp/lib/cell-group/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/checkbox/README.md b/packages/checkbox/README.md index 76ee43f1..a7603222 100644 --- a/packages/checkbox/README.md +++ b/packages/checkbox/README.md @@ -2,6 +2,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-checkbox": "path/to/vant-weapp/dist/checkbox/index", @@ -9,6 +11,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-checkbox": "path/to/vant-weapp/lib/checkbox/index", + "van-checkbox-group": "path/to/vant-weapp/lib/checkbox-group/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/col/README.md b/packages/col/README.md index e578d750..7d5de306 100644 --- a/packages/col/README.md +++ b/packages/col/README.md @@ -3,6 +3,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-row": "path/to/vant-weapp/dist/row/index", @@ -10,11 +12,19 @@ } ``` +es5 +```json +"usingComponents": { + "van-row": "path/to/vant-weapp/lib/row/index", + "van-col": "path/to/vant-weapp/lib/col/index" +} +``` + ### 代码演示 #### 基本用法 -Layout 组件提供了`24列栅格`,通过在`Col`上添加`span`属性设置列所占的宽度百分比 +Layout 组件提供了`24列栅格`,通过在`Col`上添加`span`属性设置列所占的宽度百分比 此外,添加`offset`属性可以设置列的偏移宽度,计算方式与 span 相同 ```html diff --git a/packages/collapse/README.md b/packages/collapse/README.md index 67e3a349..9a50dbae 100644 --- a/packages/collapse/README.md +++ b/packages/collapse/README.md @@ -2,6 +2,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-collapse": "path/to/vant-weapp/dist/collapse/index", @@ -9,6 +11,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-collapse": "path/to/vant-weapp/lib/collapse/index", + "van-collapse-item": "path/to/vant-weapp/lib/collapse-item/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/datetime-picker/README.md b/packages/datetime-picker/README.md index 2b63d851..d53fe0f5 100644 --- a/packages/datetime-picker/README.md +++ b/packages/datetime-picker/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-datetime-picker": "path/to/vant-weapp/dist/datetime-picker/index" } ``` +es5 +```json +"usingComponents": { + "van-datetime-picker": "path/to/vant-weapp/lib/datetime-picker/index" +} +``` + ### 代码演示 #### 选择完整时间 diff --git a/packages/dialog/README.md b/packages/dialog/README.md index b366062e..fd55aca2 100644 --- a/packages/dialog/README.md +++ b/packages/dialog/README.md @@ -5,12 +5,21 @@ Dialog 组件支持函数调用和组件调用两种形式 ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-dialog": "path/to/vant-weapp/dist/dialog/index" } ``` +es5 +```json +"usingComponents": { + "van-dialog": "path/to/vant-weapp/lib/dialog/index" +} +``` + ### 代码演示 #### 消息提示 @@ -23,6 +32,8 @@ Dialog 组件支持函数调用和组件调用两种形式 ```javascript import Dialog from 'path/to/vant-weapp/dist/dialog/dialog'; +// es5 +// var Dialog = require('path/to/vant-weapp/lib/dialog/dialog'); Dialog.alert({ title: '标题', diff --git a/packages/field/README.md b/packages/field/README.md index 6cff4b1c..639d492c 100644 --- a/packages/field/README.md +++ b/packages/field/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-field": "path/to/vant-weapp/dist/field/index" } ``` +es5 +```json +"usingComponents": { + "van-field": "path/to/vant-weapp/lib/field/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/goods-action/README.md b/packages/goods-action/README.md index b6789cf9..ae42ffdd 100644 --- a/packages/goods-action/README.md +++ b/packages/goods-action/README.md @@ -2,6 +2,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-goods-action": "path/to/vant-weapp/dist/goods-action/index", @@ -10,6 +12,15 @@ } ``` +es5 +```json +"usingComponents": { + "van-goods-action": "path/to/vant-weapp/lib/goods-action/index", + "van-goods-action-icon": "path/to/vant-weapp/lib/goods-action-icon/index", + "van-goods-action-button": "path/to/vant-weapp/lib/goods-action-button/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/icon/README.md b/packages/icon/README.md index 6dcdf3de..494c24de 100644 --- a/packages/icon/README.md +++ b/packages/icon/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-icon": "path/to/vant-weapp/dist/icon/index" } ``` +es5 +```json +"usingComponents": { + "van-icon": "path/to/vant-weapp/lib/icon/index" +} +``` + ### 代码演示 #### 基础用法 @@ -49,11 +58,3 @@ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | -| 0.2.1 | feature | 新增 class-prefix 属性 | -| 0.3.6 | feature | 新增 custom-style 属性 | diff --git a/packages/loading/README.md b/packages/loading/README.md index dd28ffa5..4a7b892a 100644 --- a/packages/loading/README.md +++ b/packages/loading/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-loading": "path/to/vant-weapp/dist/loading/index" } ``` +es5 +```json +"usingComponents": { + "van-loading": "path/to/vant-weapp/lib/loading/index" +} +``` + ### 代码演示 #### Circular @@ -38,9 +47,3 @@ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | diff --git a/packages/nav-bar/README.md b/packages/nav-bar/README.md index 9765cc67..d170591c 100644 --- a/packages/nav-bar/README.md +++ b/packages/nav-bar/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-nav-bar": "path/to/vant-weapp/dist/nav-bar/index" } ``` +es5 +```json +"usingComponents": { + "van-nav-bar": "path/to/vant-weapp/lib/nav-bar/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/notice-bar/README.md b/packages/notice-bar/README.md index c968cd80..8fdb265e 100644 --- a/packages/notice-bar/README.md +++ b/packages/notice-bar/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-notice-bar": "path/to/vant-weapp/dist/notice-bar/index" } ``` +es5 +```json +"usingComponents": { + "van-notice-bar": "path/to/vant-weapp/lib/notice-bar/index" +} +``` + ### 代码演示 @@ -72,9 +81,3 @@ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | diff --git a/packages/notify/README.md b/packages/notify/README.md index 4a651b39..1acc2b66 100644 --- a/packages/notify/README.md +++ b/packages/notify/README.md @@ -2,11 +2,18 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json -{ - "usingComponents": { - "van-notify": "path/to/vant-weapp/dist/notify/index" - } +"usingComponents": { + "van-notify": "path/to/vant-weapp/dist/notify/index" +} +``` + +es5 +```json +"usingComponents": { + "van-notify": "path/to/vant-weapp/lib/notify/index" } ``` @@ -16,6 +23,8 @@ ```js import Notify from 'path/to/vant-weapp/dist/notify/notify'; +// es5 +var Notify = require('path/to/vant-weapp/lib/notify/notify'); Notify('通知内容'); ``` diff --git a/packages/panel/README.md b/packages/panel/README.md index 0dab7c7d..11bbdc67 100644 --- a/packages/panel/README.md +++ b/packages/panel/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-panel": "path/to/vant-weapp/dist/panel/index" } ``` +es5 +```json +"usingComponents": { + "van-panel": "path/to/vant-weapp/lib/panel/index" +} +``` + ### 代码演示 #### 基础用法 @@ -56,9 +65,3 @@ | custom-class | 根节点样式类 | | header-class | 头部样式类 | | footer-class | 底部样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | diff --git a/packages/picker/README.md b/packages/picker/README.md index dd792cd7..c8664e4d 100644 --- a/packages/picker/README.md +++ b/packages/picker/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-picker": "path/to/vant-weapp/dist/picker/index" } ``` +es5 +```json +"usingComponents": { + "van-picker": "path/to/vant-weapp/lib/picker/index" +} +``` + ### 代码演示 diff --git a/packages/popup/README.md b/packages/popup/README.md index 4a76e24b..28afb2f8 100644 --- a/packages/popup/README.md +++ b/packages/popup/README.md @@ -2,11 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-popup": "path/to/vant-weapp/dist/popup/index" } ``` + +es5 +```json +"usingComponents": { + "van-popup": "path/to/vant-weapp/lib/popup/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/progress/README.md b/packages/progress/README.md index cf3f284f..de052da0 100644 --- a/packages/progress/README.md +++ b/packages/progress/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-progress": "path/to/vant-weapp/dist/progress/index" } ``` +es5 +```json +"usingComponents": { + "van-progress": "path/to/vant-weapp/lib/progress/index" +} +``` + ### 代码演示 #### 基础用法 @@ -67,9 +76,3 @@ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.2.1 | feature | 新增组件 | diff --git a/packages/radio/README.md b/packages/radio/README.md index ec9b97e2..d3235643 100644 --- a/packages/radio/README.md +++ b/packages/radio/README.md @@ -3,6 +3,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-radio": "path/to/vant-weapp/dist/radio/index", @@ -10,6 +12,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-radio": "path/to/vant-weapp/lib/radio/index", + "van-radio-group": "path/to/vant-weapp/lib/radio-group/index" +} +``` + ### 代码演示 #### 基础用法 @@ -101,9 +111,3 @@ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.3.4 | feature | 新增组件 | diff --git a/packages/rate/README.md b/packages/rate/README.md index 8deea205..d33e7ba3 100644 --- a/packages/rate/README.md +++ b/packages/rate/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-rate": "path/to/vant-weapp/dist/rate/index" } ``` +es5 +```json +"usingComponents": { + "van-rate": "path/to/vant-weapp/lib/rate/index" +} +``` + ### 代码演示 #### 基础用法 @@ -92,10 +101,3 @@ Page({ |-----------|-----------| | custom-class | 根节点样式类 | | icon-class | 图标样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.4.7 | feature | 新增组件 | -| 0.4.9 | feature | 增加 icon-class 外部样式类 | diff --git a/packages/search/README.md b/packages/search/README.md index f166db09..c73aa17c 100644 --- a/packages/search/README.md +++ b/packages/search/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-search": "path/to/vant-weapp/dist/search/index" } ``` +es5 +```json +"usingComponents": { + "van-search": "path/to/vant-weapp/lib/search/index" +} +``` + ### 代码演示 #### 基础用法 @@ -91,12 +100,3 @@ | field-class | 搜索框样式类 | | input-class | 输入框样式类 | | cancel-class | 取消按钮样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | -| 0.2.1 | feature | 支持在原生 form 组件内使用 | -| 0.2.1 | bugfix | 修复 focus 属性不生效的问题 | -| 0.3.4 | bugfix | 修复无法获取到输入值的问题 | diff --git a/packages/slider/README.md b/packages/slider/README.md index 1bea8230..c34862c3 100644 --- a/packages/slider/README.md +++ b/packages/slider/README.md @@ -2,11 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { - "van-slider": "/packages/slider/index" + "van-slider": "path/to/vant-weapp/dist/slider/index" } ``` + +es5 +```json +"usingComponents": { + "van-slider": "path/to/vant-weapp/lib/slider/index" +} +``` + #### 基本用法 ```html @@ -133,9 +143,3 @@ Page({ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.2.0 | feature | 新增组件 | diff --git a/packages/stepper/README.md b/packages/stepper/README.md index 512db05c..a6e9159b 100644 --- a/packages/stepper/README.md +++ b/packages/stepper/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-stepper": "path/to/vant-weapp/dist/stepper/index" } ``` +es5 +```json +"usingComponents": { + "van-stepper": "path/to/vant-weapp/lib/stepper/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/steps/README.md b/packages/steps/README.md index 517d6ffe..93ec2807 100644 --- a/packages/steps/README.md +++ b/packages/steps/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-steps": "path/to/vant-weapp/dist/steps/index" } ``` +es5 +```json +"usingComponents": { + "van-steps": "path/to/vant-weapp/lib/steps/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/submit-bar/README.md b/packages/submit-bar/README.md index 2d8a829c..4d60ae9a 100644 --- a/packages/submit-bar/README.md +++ b/packages/submit-bar/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-submit-bar": "path/to/vant-weapp/dist/submit-bar/index" } ``` +es5 +```json +"usingComponents": { + "van-submit-bar": "path/to/vant-weapp/lib/submit-bar/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/swipe-cell/README.md b/packages/swipe-cell/README.md index 296004cb..38e92e09 100644 --- a/packages/swipe-cell/README.md +++ b/packages/swipe-cell/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-swipe-cell": "path/to/vant-weapp/dist/swipe-cell/index" } ``` +es5 +```json +"usingComponents": { + "van-swipe-cell": "path/to/vant-weapp/lib/swipe-cell/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/switch-cell/README.md b/packages/switch-cell/README.md index 978eb33a..ac5ad420 100644 --- a/packages/switch-cell/README.md +++ b/packages/switch-cell/README.md @@ -2,12 +2,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-switch-cell": "path/to/vant-weapp/dist/switch-cell/index" } ``` +es5 +```json +"usingComponents": { + "van-switch-cell": "path/to/vant-weapp/lib/switch-cell/index" +} +``` + ### 代码演示 #### 基础用法 @@ -77,10 +86,3 @@ Page({ | 事件名 | 说明 | 参数 | |-----------|-----------|-----------| | bind:change | 开关状态切换回调 | event.detail: 是否选中开关 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.2.0 | feature | 新增组件 | -| 0.2.1 | feature | 支持在原生 form 组件内使用 | diff --git a/packages/switch/README.md b/packages/switch/README.md index 5eafd38e..2f3d8cb9 100644 --- a/packages/switch/README.md +++ b/packages/switch/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-switch": "path/to/vant-weapp/dist/switch/index" } ``` +es5 +```json +"usingComponents": { + "van-switch": "path/to/vant-weapp/lib/switch/index" +} +``` + ### 代码演示 #### 基础用法 @@ -113,11 +122,3 @@ Page({ |-----------|-----------| | custom-class | 根节点样式类 | | node-class | 圆点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | -| 0.1.1 | bugfix | 修复组件无法开关的问题 | -| 0.2.1 | feature | 支持在原生 form 组件内使用 | diff --git a/packages/tab/README.md b/packages/tab/README.md index 40a34d72..0a4bdc06 100644 --- a/packages/tab/README.md +++ b/packages/tab/README.md @@ -2,6 +2,8 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-tab": "path/to/vant-weapp/dist/tab/index", @@ -9,6 +11,14 @@ } ``` +es5 +```json +"usingComponents": { + "van-tab": "path/to/vant-weapp/lib/tab/index", + "van-tabs": "path/to/vant-weapp/lib/tabs/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/tabbar/README.md b/packages/tabbar/README.md index e34c36cb..c06bdd8a 100644 --- a/packages/tabbar/README.md +++ b/packages/tabbar/README.md @@ -2,10 +2,20 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { - "van-tabbar": "/packages/tabbar/index", - "van-tabbar-item": "/packages/tabbar-item/index" + "van-tabbar": "path/to/vant-weapp/dist/tabbar/index", + "van-tabbar-item": "path/to/vant-weapp/dist/tabbar-item/index" +} +``` + +es6 +```json +"usingComponents": { + "van-tabbar": "path/to/vant-weapp/lib/tabbar/index", + "van-tabbar-item": "path/to/vant-weapp/lib/tabbar-item/index" } ``` diff --git a/packages/tag/README.md b/packages/tag/README.md index 03d263af..05b1147a 100644 --- a/packages/tag/README.md +++ b/packages/tag/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-tag": "path/to/vant-weapp/dist/tag/index" } ``` +es5 +```json +"usingComponents": { + "van-tag": "path/to/vant-weapp/lib/tag/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/toast/README.md b/packages/toast/README.md index 436d08f5..80476757 100644 --- a/packages/toast/README.md +++ b/packages/toast/README.md @@ -3,18 +3,29 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-toast": "path/to/vant-weapp/dist/toast/index" } ``` +es5 +```json +"usingComponents": { + "van-toast": "path/to/vant-weapp/lib/toast/index" +} +``` + ### 代码演示 #### 文字提示 ```javascript import Toast from 'path/to/vant-weapp/dist/toast/toast'; +// es5 +// vat Toast = require('path/to/vant-weapp/lib/toast/toast'); Toast('我是提示文案,建议不超过十五字~'); ``` @@ -94,12 +105,3 @@ const timer = setInterval(() => { | duration | 展示时长(ms),值为 0 时,toast 不会消失 | `Number` | `3000` | | selector | 自定义选择器 | `String` | `van-toast` | | context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.1.1 | feature | 新增组件 | -| 0.3.0 | breaking change | 修改组件引入路径,避免编辑器报错的问题 | -| 0.3.2 | feature | 新增 z-index 属性 | -| 0.3.3 | bugfix | 修复滚动穿透问题 | diff --git a/packages/transition/README.md b/packages/transition/README.md index 81db405a..dea540f5 100644 --- a/packages/transition/README.md +++ b/packages/transition/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-transition": "path/to/vant-weapp/dist/transition/index" } ``` +es5 +```json +"usingComponents": { + "van-transition": "path/to/vant-weapp/lib/transition/index" +} +``` + ### 代码演示 #### 基础用法 diff --git a/packages/tree-select/README.md b/packages/tree-select/README.md index 13b3e344..da2046c5 100644 --- a/packages/tree-select/README.md +++ b/packages/tree-select/README.md @@ -3,12 +3,21 @@ ### 使用指南 在 app.json 或 index.json 中引入组件 + +es6 ```json "usingComponents": { "van-tree-select": "path/to/vant-weapp/dist/tree-select/index" } ``` +es5 +```json +"usingComponents": { + "van-tree-select": "path/to/vant-weapp/lib/tree-select/index" +} +``` + ### 代码演示 可以在任意位置上使用 van-tree-select 标签。传入对应的数据即可。 ```html @@ -98,9 +107,3 @@ Page({ | content-active-class | 右侧选项选中样式类 | | main-disabled-class | 左侧选项禁用样式类 | | content-disabled-class | 右侧选项禁用样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 |