mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] Area: reset method support code param
This commit is contained in:
parent
80a7b7cae9
commit
73f34be3a8
@ -36,10 +36,10 @@
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# install vant 1.x
|
||||
# install 1.x stable
|
||||
npm i vant -S
|
||||
|
||||
# install vant 2.0 beta
|
||||
# install 2.0 beta
|
||||
npm i vant@beta -S
|
||||
```
|
||||
|
||||
|
@ -35,10 +35,10 @@
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
# 安装 vant 1.x 稳定版本
|
||||
# 安装 1.x 稳定版本
|
||||
npm i vant -S
|
||||
|
||||
# 安装 vant 2.0 测试版本
|
||||
# 安装 2.0 测试版本
|
||||
npm i vant@beta -S
|
||||
```
|
||||
|
||||
|
@ -16,6 +16,10 @@
|
||||
- DropdownMenu
|
||||
- NumberKeyboard
|
||||
|
||||
##### Area
|
||||
|
||||
- 支持`reset`方法传入`code`参数
|
||||
|
||||
##### ImagePreview
|
||||
|
||||
- 新增`close-on-popstate`属性
|
||||
|
@ -22,10 +22,10 @@ In the GUI, click on 'Dependencies' -> `Install Dependencies` and add `vant` to
|
||||
### Install
|
||||
|
||||
```bash
|
||||
# install vant 1.x
|
||||
# install 1.x stable
|
||||
npm i vant -S
|
||||
|
||||
# install vant 2.0 beta
|
||||
# install 2.0 beta
|
||||
npm i vant@beta -S
|
||||
```
|
||||
|
||||
|
@ -31,10 +31,10 @@ vue ui
|
||||
### 安装
|
||||
|
||||
```bash
|
||||
# 安装 vant 1.x 稳定版本
|
||||
# 安装 1.x 稳定版本
|
||||
npm i vant -S
|
||||
|
||||
# 安装 vant 2.0 测试版本
|
||||
# 安装 2.0 测试版本
|
||||
npm i vant@beta -S
|
||||
```
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<demo-section>
|
||||
<demo-block :title="$t('basicUsage')">
|
||||
<van-area
|
||||
ref="area"
|
||||
:area-list="$t('areaList')"
|
||||
/>
|
||||
<van-area :area-list="$t('areaList')" />
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('title2')">
|
||||
|
@ -69,7 +69,7 @@ Use ref to get area instance and call instance methods
|
||||
|
||||
| Name | Attribute | Return value | Description |
|
||||
|------|------|------|------|
|
||||
| reset | - | - | Reset all options |
|
||||
| reset | code: string | - | Reset all options by code |
|
||||
|
||||
### areaList Data Structure
|
||||
|
||||
|
@ -171,8 +171,8 @@ export default sfc({
|
||||
return area;
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.code = '';
|
||||
reset(code) {
|
||||
this.code = code || '';
|
||||
this.setValues();
|
||||
}
|
||||
},
|
||||
|
@ -68,7 +68,7 @@ Vue.use(Area);
|
||||
|
||||
| 方法名 | 参数 | 返回值 | 介绍 |
|
||||
|------|------|------|------|
|
||||
| reset | - | - | 重置所有选项到第一项 |
|
||||
| reset | code: string | - | 根据 code 重置所有选项,若不传 code,则重置到第一项 |
|
||||
|
||||
### 省市区列表数据格式
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user