mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
docs: fix method name conflicts with lifecycle (#2927)
This commit is contained in:
parent
e49b96e7a5
commit
0fece1552c
@ -17,7 +17,7 @@
|
|||||||
下面演示了结合单元格来使用日历组件的用法,日期选择完成后会触发`confirm`事件
|
下面演示了结合单元格来使用日历组件的用法,日期选择完成后会触发`confirm`事件
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="选择单个日期" value="{{ date }}" bind:click="onShow" />
|
<van-cell title="选择单个日期" value="{{ date }}" bind:click="onDisplay" />
|
||||||
<van-calendar show="{{ show }}" bind:close="onClose" bind:confirm="onConfirm" />
|
<van-calendar show="{{ show }}" bind:close="onClose" bind:confirm="onConfirm" />
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Page({
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onDisplay() {
|
||||||
this.setData({ show: true });
|
this.setData({ show: true });
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
@ -52,7 +52,7 @@ Page({
|
|||||||
设置`type`为`multiple`后可以选择多个日期,此时`confirm`事件返回的 date 为数组结构,数组包含若干个选中的日期。
|
设置`type`为`multiple`后可以选择多个日期,此时`confirm`事件返回的 date 为数组结构,数组包含若干个选中的日期。
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="选择多个日期" value="{{ text }}" bind:click="onShow" />
|
<van-cell title="选择多个日期" value="{{ text }}" bind:click="onDisplay" />
|
||||||
<van-calendar
|
<van-calendar
|
||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
type="multiple"
|
type="multiple"
|
||||||
@ -68,7 +68,7 @@ Page({
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onDisplay() {
|
||||||
this.setData({ show: true });
|
this.setData({ show: true });
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
@ -88,7 +88,7 @@ Page({
|
|||||||
设置`type`为`range`后可以选择日期区间,此时`confirm`事件返回的 date 为数组结构,数组第一项为开始时间,第二项为结束时间。
|
设置`type`为`range`后可以选择日期区间,此时`confirm`事件返回的 date 为数组结构,数组第一项为开始时间,第二项为结束时间。
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="选择日期区间" value="{{ date }}" bind:click="onShow" />
|
<van-cell title="选择日期区间" value="{{ date }}" bind:click="onDisplay" />
|
||||||
<van-calendar
|
<van-calendar
|
||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
type="range"
|
type="range"
|
||||||
@ -104,7 +104,7 @@ Page({
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onDisplay() {
|
||||||
this.setData({ show: true });
|
this.setData({ show: true });
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user