[new feature] Area: reset method support code param
This commit is contained in:
@@ -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,则重置到第一项 |
|
||||
|
||||
### 省市区列表数据格式
|
||||
|
||||
|
||||
Reference in New Issue
Block a user