mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-08-07 13:49:48 +08:00
docs: fix some doc error @rex-zsd (#963)
This commit is contained in:
parent
1a3438a98a
commit
a2546d8623
@ -24,37 +24,33 @@
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
Page({
|
Page({
|
||||||
data() {
|
data: {
|
||||||
return {
|
show: false,
|
||||||
show: false,
|
actions: [
|
||||||
actions: [
|
{
|
||||||
{
|
name: '选项'
|
||||||
name: '选项'
|
},
|
||||||
},
|
{
|
||||||
{
|
name: '分享',
|
||||||
name: '分享',
|
subname: '描述信息',
|
||||||
subname: '描述信息',
|
openType: 'share'
|
||||||
openType: 'share'
|
},
|
||||||
},
|
{
|
||||||
{
|
loading: true
|
||||||
loading: true
|
},
|
||||||
},
|
{
|
||||||
{
|
name: '禁用选项',
|
||||||
name: '禁用选项',
|
disabled: true
|
||||||
disabled: true
|
}
|
||||||
}
|
]
|
||||||
]
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
onClose() {
|
||||||
onClose() {
|
this.setData({ show: false });
|
||||||
this.setData({ show: false });
|
},
|
||||||
},
|
|
||||||
|
|
||||||
onSelect(event) {
|
onSelect(event) {
|
||||||
console.log(event.detail);
|
console.log(event.detail);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
@ -25,20 +25,18 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
export default {
|
Page({
|
||||||
data: {
|
data: {
|
||||||
active: 0
|
active: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
onChange(event) {
|
||||||
onChange(event) {
|
wx.showToast({
|
||||||
wx.showToast({
|
icon: 'none',
|
||||||
icon: 'none',
|
title: `切换至第${event.detail}项`
|
||||||
title: `切换至第${event.detail}项`
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### BadgeGroup API
|
### BadgeGroup API
|
||||||
|
@ -32,6 +32,7 @@ Page({
|
|||||||
maxDate: new Date(2019, 10, 1).getTime(),
|
maxDate: new Date(2019, 10, 1).getTime(),
|
||||||
currentDate: new Date().getTime()
|
currentDate: new Date().getTime()
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentDate: event.detail.value
|
currentDate: event.detail.value
|
||||||
@ -57,6 +58,7 @@ Page({
|
|||||||
currentDate: new Date().getTime(),
|
currentDate: new Date().getTime(),
|
||||||
minDate: new Date().getTime()
|
minDate: new Date().getTime()
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentDate: event.detail.value
|
currentDate: event.detail.value
|
||||||
@ -82,6 +84,7 @@ Page({
|
|||||||
currentDate: new Date().getTime(),
|
currentDate: new Date().getTime(),
|
||||||
minDate: new Date().getTime()
|
minDate: new Date().getTime()
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentDate: event.detail.value
|
currentDate: event.detail.value
|
||||||
@ -109,6 +112,7 @@ Page({
|
|||||||
minHour: 9,
|
minHour: 9,
|
||||||
maxHour: 23
|
maxHour: 23
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentDate: event.detail.value
|
currentDate: event.detail.value
|
||||||
|
@ -25,16 +25,14 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
Page({
|
||||||
methods: {
|
onClickLeft() {
|
||||||
onClickLeft() {
|
wx.showToast({ title: '点击返回', icon: 'none' });
|
||||||
wx.showToast({ title: '点击返回', icon: 'none' });
|
},
|
||||||
},
|
onClickRight() {
|
||||||
onClickRight() {
|
wx.showToast({ title: '点击按钮', icon: 'none' });
|
||||||
wx.showToast({ title: '点击按钮', icon: 'none' });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 高级用法
|
#### 高级用法
|
||||||
|
@ -36,26 +36,24 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
Page({
|
||||||
methods: {
|
onClose(event) {
|
||||||
onClose(event) {
|
const { position, instance } = event.detail;
|
||||||
const { position, instance } = event.detail;
|
switch (position) {
|
||||||
switch (position) {
|
case 'left':
|
||||||
case 'left':
|
case 'cell':
|
||||||
case 'cell':
|
instance.close();
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
Dialog.confirm({
|
||||||
|
message: '确定删除吗?'
|
||||||
|
}).then(() => {
|
||||||
instance.close();
|
instance.close();
|
||||||
break;
|
});
|
||||||
case 'right':
|
break;
|
||||||
Dialog.confirm({
|
|
||||||
message: '确定删除吗?'
|
|
||||||
}).then(() => {
|
|
||||||
instance.close();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
@ -54,13 +54,14 @@ Page({
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
Page({
|
Page({
|
||||||
data() {
|
data: {
|
||||||
active: 0,
|
active: 0,
|
||||||
icon: {
|
icon: {
|
||||||
normal: '//img.yzcdn.cn/icon-normal.png',
|
normal: '//img.yzcdn.cn/icon-normal.png',
|
||||||
active: '//img.yzcdn.cn/icon-active.png'
|
active: '//img.yzcdn.cn/icon-active.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
console.log(event.detail);
|
console.log(event.detail);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user