mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
types(Checkbox): add toggle method type (#5354)
This commit is contained in:
@@ -232,7 +232,7 @@ export default {
|
||||
|
||||
| 方法名 | 说明 | 参数 | 返回值 |
|
||||
|------|------|------|------|
|
||||
| toggleAll | 切换所有复选框的选中状态 | checked?: boolean | - |
|
||||
| toggleAll | 切换所有复选框,传`true`为选中,`false`为取消选中,不传参为取反 | checked?: boolean | - |
|
||||
|
||||
### Checkbox 方法
|
||||
|
||||
@@ -240,4 +240,4 @@ export default {
|
||||
|
||||
| 方法名 | 说明 | 参数 | 返回值 |
|
||||
|------|------|------|------|
|
||||
| toggle | 切换选中状态 | checked?: boolean | - |
|
||||
| toggle | 切换选中状态,传`true`为选中,`false`为取消选中,不传参为取反 | checked?: boolean | - |
|
||||
|
@@ -33,6 +33,7 @@ export default createComponent({
|
||||
},
|
||||
|
||||
methods: {
|
||||
// @exposed-api
|
||||
toggle(checked = !this.checked) {
|
||||
// When toggle method is called multiple times at the same time,
|
||||
// only the last call is valid.
|
||||
|
Reference in New Issue
Block a user