feat(Switch): add click event (#4915)

This commit is contained in:
neverland
2019-11-04 17:58:20 +08:00
committed by GitHub
parent a19d3cc5c0
commit 577174c7f8
5 changed files with 62 additions and 77 deletions
+9 -24
View File
@@ -30,47 +30,31 @@ export default {
### Disabled
```html
<van-switch
v-model="checked"
disabled
/>
<van-switch v-model="checked" disabled />
```
### Loading
```html
<van-switch
v-model="checked"
loading
/>
<van-switch v-model="checked" loading />
```
### Custom Size
```html
<van-switch
v-model="checked"
size="24px"
/>
<van-switch v-model="checked" size="24px" />
```
### Custom Color
```html
<van-switch
v-model="checked"
active-color="#07c160"
inactive-color="#ee0a24"
/>
<van-switch v-model="checked" active-color="#07c160" inactive-color="#ee0a24" />
```
### Async Control
```html
<van-switch
:value="checked"
@input="onInput"
/>
<van-switch :value="checked" @input="onInput" />
```
```js
@@ -111,6 +95,7 @@ export default {
### Events
| Event | Description | Parameters |
|------|------|------|
| change | Triggered when check status changed | checked: is switch checked |
| Event | Description | Parameters | Version |
|------|------|------|------|
| change | Triggered when check status changed | checked: is switch checked | - |
| click | Triggered when clicked | event: Event | 2.2.11 |