[docs]: add es5 guide

This commit is contained in:
rex 2019-04-03 20:15:05 +08:00 committed by GitHub
parent 86226c6514
commit 53ff09b3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 386 additions and 110 deletions

View File

@ -62,7 +62,7 @@ git clone https://github.com/youzan/vant-weapp.git
接着就可以在 wxml 中直接使用组件 接着就可以在 wxml 中直接使用组件
```xml ```html
<van-button type="primary">按钮</van-button> <van-button type="primary">按钮</van-button>
``` ```

View File

@ -20,7 +20,7 @@ yarn add vant-weapp --production
#### 方式二. 下载代码 #### 方式二. 下载代码
直接通过 git 下载 Vant Weapp 源代码,并将`dist`目录拷贝到自己的项目中 直接通过 git 下载 Vant Weapp 源代码,并将`dist``lib`目录拷贝到自己的项目中
```bash ```bash
git clone https://github.com/youzan/vant-weapp.git git clone https://github.com/youzan/vant-weapp.git
``` ```
@ -29,11 +29,19 @@ git clone https://github.com/youzan/vant-weapp.git
以按钮组件为例,只需要在 json 文件中引入按钮对应的自定义组件即可 以按钮组件为例,只需要在 json 文件中引入按钮对应的自定义组件即可
某些小程序框架会要求关闭`ES6转ES5`选项,可以引入`lib`目录内es5版本的组件
es6
```json ```json
{ "usingComponents": {
"usingComponents": {
"van-button": "/path/to/vant-weapp/dist/button/index" "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
<van-button type="primary">按钮</van-button> <van-button type="primary">按钮</van-button>
``` ```
### 在开发者工具中预览 ### 在开发者工具中预览示例小程序
```bash ```bash
# 安装项目依赖 # 安装项目依赖
@ -53,4 +61,4 @@ npm install
npm run dev 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`目录的项目就可以预览示例了。

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-action-sheet": "path/to/vant-weapp/dist/action-sheet/index" "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -4,12 +4,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-area": "path/to/vant-weapp/dist/area/index" "van-area": "path/to/vant-weapp/dist/area/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-area": "path/to/vant-weapp/lib/area/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,6 +2,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-badge": "path/to/vant-weapp/dist/badge/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 json 文件中配置button组件 在 json 文件中配置button组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-button": "path/to/vant-weapp/dist/button/index" "van-button": "path/to/vant-weapp/dist/button/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-button": "path/to/vant-weapp/lib/button/index"
}
```
### 代码演示 ### 代码演示
#### 按钮类型 #### 按钮类型

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-card": "path/to/vant-weapp/dist/card/index" "van-card": "path/to/vant-weapp/dist/card/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-card": "path/to/vant-weapp/lib/card/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,6 +3,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-cell": "path/to/vant-weapp/dist/cell/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,6 +2,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-checkbox": "path/to/vant-weapp/dist/checkbox/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,6 +3,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-row": "path/to/vant-weapp/dist/row/index", "van-row": "path/to/vant-weapp/dist/row/index",
@ -10,6 +12,14 @@
} }
``` ```
es5
```json
"usingComponents": {
"van-row": "path/to/vant-weapp/lib/row/index",
"van-col": "path/to/vant-weapp/lib/col/index"
}
```
### 代码演示 ### 代码演示
#### 基本用法 #### 基本用法

View File

@ -2,6 +2,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-collapse": "path/to/vant-weapp/dist/collapse/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-datetime-picker": "path/to/vant-weapp/dist/datetime-picker/index" "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"
}
```
### 代码演示 ### 代码演示
#### 选择完整时间 #### 选择完整时间

View File

@ -5,12 +5,21 @@ Dialog 组件支持函数调用和组件调用两种形式
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-dialog": "path/to/vant-weapp/dist/dialog/index" "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 ```javascript
import Dialog from 'path/to/vant-weapp/dist/dialog/dialog'; import Dialog from 'path/to/vant-weapp/dist/dialog/dialog';
// es5
// var Dialog = require('path/to/vant-weapp/lib/dialog/dialog');
Dialog.alert({ Dialog.alert({
title: '标题', title: '标题',

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-field": "path/to/vant-weapp/dist/field/index" "van-field": "path/to/vant-weapp/dist/field/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-field": "path/to/vant-weapp/lib/field/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,6 +2,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-goods-action": "path/to/vant-weapp/dist/goods-action/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-icon": "path/to/vant-weapp/dist/icon/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |
| 0.2.1 | feature | 新增 class-prefix 属性 |
| 0.3.6 | feature | 新增 custom-style 属性 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-loading": "path/to/vant-weapp/dist/loading/index" "van-loading": "path/to/vant-weapp/dist/loading/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-loading": "path/to/vant-weapp/lib/loading/index"
}
```
### 代码演示 ### 代码演示
#### Circular #### Circular
@ -38,9 +47,3 @@
| 类名 | 说明 | | 类名 | 说明 |
|-----------|-----------| |-----------|-----------|
| custom-class | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-nav-bar": "path/to/vant-weapp/dist/nav-bar/index" "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-notice-bar": "path/to/vant-weapp/dist/notice-bar/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |

View File

@ -2,11 +2,18 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
{ "usingComponents": {
"usingComponents": {
"van-notify": "path/to/vant-weapp/dist/notify/index" "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 ```js
import Notify from 'path/to/vant-weapp/dist/notify/notify'; import Notify from 'path/to/vant-weapp/dist/notify/notify';
// es5
var Notify = require('path/to/vant-weapp/lib/notify/notify');
Notify('通知内容'); Notify('通知内容');
``` ```

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-panel": "path/to/vant-weapp/dist/panel/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
| header-class | 头部样式类 | | header-class | 头部样式类 |
| footer-class | 底部样式类 | | footer-class | 底部样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-picker": "path/to/vant-weapp/dist/picker/index" "van-picker": "path/to/vant-weapp/dist/picker/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-picker": "path/to/vant-weapp/lib/picker/index"
}
```
### 代码演示 ### 代码演示

View File

@ -2,11 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-popup": "path/to/vant-weapp/dist/popup/index" "van-popup": "path/to/vant-weapp/dist/popup/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-popup": "path/to/vant-weapp/lib/popup/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-progress": "path/to/vant-weapp/dist/progress/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.2.1 | feature | 新增组件 |

View File

@ -3,6 +3,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-radio": "path/to/vant-weapp/dist/radio/index", "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 | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.3.4 | feature | 新增组件 |

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-rate": "path/to/vant-weapp/dist/rate/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
| icon-class | 图标样式类 | | icon-class | 图标样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.4.7 | feature | 新增组件 |
| 0.4.9 | feature | 增加 icon-class 外部样式类 |

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-search": "path/to/vant-weapp/dist/search/index" "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 | 搜索框样式类 | | field-class | 搜索框样式类 |
| input-class | 输入框样式类 | | input-class | 输入框样式类 |
| cancel-class | 取消按钮样式类 | | cancel-class | 取消按钮样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |
| 0.2.1 | feature | 支持在原生 form 组件内使用 |
| 0.2.1 | bugfix | 修复 focus 属性不生效的问题 |
| 0.3.4 | bugfix | 修复无法获取到输入值的问题 |

View File

@ -2,11 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "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 ```html
@ -133,9 +143,3 @@ Page({
| 类名 | 说明 | | 类名 | 说明 |
|-----------|-----------| |-----------|-----------|
| custom-class | 根节点样式类 | | custom-class | 根节点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.2.0 | feature | 新增组件 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-stepper": "path/to/vant-weapp/dist/stepper/index" "van-stepper": "path/to/vant-weapp/dist/stepper/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-stepper": "path/to/vant-weapp/lib/stepper/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-steps": "path/to/vant-weapp/dist/steps/index" "van-steps": "path/to/vant-weapp/dist/steps/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-steps": "path/to/vant-weapp/lib/steps/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-submit-bar": "path/to/vant-weapp/dist/submit-bar/index" "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-swipe-cell": "path/to/vant-weapp/dist/swipe-cell/index" "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,12 +2,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-switch-cell": "path/to/vant-weapp/dist/switch-cell/index" "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: 是否选中开关 | | bind:change | 开关状态切换回调 | event.detail: 是否选中开关 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.2.0 | feature | 新增组件 |
| 0.2.1 | feature | 支持在原生 form 组件内使用 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-switch": "path/to/vant-weapp/dist/switch/index" "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 | 根节点样式类 | | custom-class | 根节点样式类 |
| node-class | 圆点样式类 | | node-class | 圆点样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |
| 0.1.1 | bugfix | 修复组件无法开关的问题 |
| 0.2.1 | feature | 支持在原生 form 组件内使用 |

View File

@ -2,6 +2,8 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-tab": "path/to/vant-weapp/dist/tab/index", "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"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -2,10 +2,20 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-tabbar": "/packages/tabbar/index", "van-tabbar": "path/to/vant-weapp/dist/tabbar/index",
"van-tabbar-item": "/packages/tabbar-item/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"
} }
``` ```

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-tag": "path/to/vant-weapp/dist/tag/index" "van-tag": "path/to/vant-weapp/dist/tag/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-tag": "path/to/vant-weapp/lib/tag/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,18 +3,29 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-toast": "path/to/vant-weapp/dist/toast/index" "van-toast": "path/to/vant-weapp/dist/toast/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-toast": "path/to/vant-weapp/lib/toast/index"
}
```
### 代码演示 ### 代码演示
#### 文字提示 #### 文字提示
```javascript ```javascript
import Toast from 'path/to/vant-weapp/dist/toast/toast'; import Toast from 'path/to/vant-weapp/dist/toast/toast';
// es5
// vat Toast = require('path/to/vant-weapp/lib/toast/toast');
Toast('我是提示文案,建议不超过十五字~'); Toast('我是提示文案,建议不超过十五字~');
``` ```
@ -94,12 +105,3 @@ const timer = setInterval(() => {
| duration | 展示时长(ms),值为 0 时toast 不会消失 | `Number` | `3000` | | duration | 展示时长(ms),值为 0 时toast 不会消失 | `Number` | `3000` |
| selector | 自定义选择器 | `String` | `van-toast` | | selector | 自定义选择器 | `String` | `van-toast` |
| context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 | | context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.1.1 | feature | 新增组件 |
| 0.3.0 | breaking change | 修改组件引入路径,避免编辑器报错的问题 |
| 0.3.2 | feature | 新增 z-index 属性 |
| 0.3.3 | bugfix | 修复滚动穿透问题 |

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-transition": "path/to/vant-weapp/dist/transition/index" "van-transition": "path/to/vant-weapp/dist/transition/index"
} }
``` ```
es5
```json
"usingComponents": {
"van-transition": "path/to/vant-weapp/lib/transition/index"
}
```
### 代码演示 ### 代码演示
#### 基础用法 #### 基础用法

View File

@ -3,12 +3,21 @@
### 使用指南 ### 使用指南
在 app.json 或 index.json 中引入组件 在 app.json 或 index.json 中引入组件
es6
```json ```json
"usingComponents": { "usingComponents": {
"van-tree-select": "path/to/vant-weapp/dist/tree-select/index" "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 标签。传入对应的数据即可。 可以在任意位置上使用 van-tree-select 标签。传入对应的数据即可。
```html ```html
@ -98,9 +107,3 @@ Page({
| content-active-class | 右侧选项选中样式类 | | content-active-class | 右侧选项选中样式类 |
| main-disabled-class | 左侧选项禁用样式类 | | main-disabled-class | 左侧选项禁用样式类 |
| content-disabled-class | 右侧选项禁用样式类 | | content-disabled-class | 右侧选项禁用样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |