mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(Checkbox): add toggle method type (#5354)
This commit is contained in:
parent
24def10a1e
commit
216ca56e63
@ -232,7 +232,7 @@ export default {
|
|||||||
|
|
||||||
| 方法名 | 说明 | 参数 | 返回值 |
|
| 方法名 | 说明 | 参数 | 返回值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| toggleAll | 切换所有复选框的选中状态 | checked?: boolean | - |
|
| toggleAll | 切换所有复选框,传`true`为选中,`false`为取消选中,不传参为取反 | checked?: boolean | - |
|
||||||
|
|
||||||
### Checkbox 方法
|
### Checkbox 方法
|
||||||
|
|
||||||
@ -240,4 +240,4 @@ export default {
|
|||||||
|
|
||||||
| 方法名 | 说明 | 参数 | 返回值 |
|
| 方法名 | 说明 | 参数 | 返回值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| toggle | 切换选中状态 | checked?: boolean | - |
|
| toggle | 切换选中状态,传`true`为选中,`false`为取消选中,不传参为取反 | checked?: boolean | - |
|
||||||
|
@ -33,6 +33,7 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// @exposed-api
|
||||||
toggle(checked = !this.checked) {
|
toggle(checked = !this.checked) {
|
||||||
// When toggle method is called multiple times at the same time,
|
// When toggle method is called multiple times at the same time,
|
||||||
// only the last call is valid.
|
// only the last call is valid.
|
||||||
|
5
types/checkbox-group.d.ts
vendored
Normal file
5
types/checkbox-group.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { VanComponent } from './component';
|
||||||
|
|
||||||
|
export class CheckboxGroup extends VanComponent {
|
||||||
|
toggleAll(checked?: boolean): void;
|
||||||
|
}
|
5
types/checkbox.d.ts
vendored
Normal file
5
types/checkbox.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { VanComponent } from './component';
|
||||||
|
|
||||||
|
export class Checkbox extends VanComponent {
|
||||||
|
toggle(checked?: boolean): void;
|
||||||
|
}
|
14
types/index.d.ts
vendored
14
types/index.d.ts
vendored
@ -2,12 +2,14 @@ import Vue from 'vue';
|
|||||||
import { VanComponent } from './component';
|
import { VanComponent } from './component';
|
||||||
import { AddressEdit } from './address-edit';
|
import { AddressEdit } from './address-edit';
|
||||||
import { Area } from './area';
|
import { Area } from './area';
|
||||||
import { Toast } from './toast';
|
import { Checkbox } from './checkbox';
|
||||||
|
import { CheckboxGroup } from './checkbox-group';
|
||||||
import { Dialog } from './dialog';
|
import { Dialog } from './dialog';
|
||||||
import { Notify } from './notify';
|
|
||||||
import { Locale } from './locale';
|
|
||||||
import { Lazyload } from './lazyload';
|
|
||||||
import { ImagePreview } from './image-preview';
|
import { ImagePreview } from './image-preview';
|
||||||
|
import { Lazyload } from './lazyload';
|
||||||
|
import { Locale } from './locale';
|
||||||
|
import { Notify } from './notify';
|
||||||
|
import { Toast } from './toast';
|
||||||
|
|
||||||
export const version: string;
|
export const version: string;
|
||||||
export function install(vue: typeof Vue): void;
|
export function install(vue: typeof Vue): void;
|
||||||
@ -20,8 +22,6 @@ export class CellGroup extends VanComponent {}
|
|||||||
export class CountDown extends VanComponent {}
|
export class CountDown extends VanComponent {}
|
||||||
export class Divider extends VanComponent {}
|
export class Divider extends VanComponent {}
|
||||||
export class SwipeCell extends VanComponent {}
|
export class SwipeCell extends VanComponent {}
|
||||||
export class Checkbox extends VanComponent {}
|
|
||||||
export class CheckboxGroup extends VanComponent {}
|
|
||||||
export class Circle extends VanComponent {}
|
export class Circle extends VanComponent {}
|
||||||
export class Col extends VanComponent {}
|
export class Col extends VanComponent {}
|
||||||
export class Collapse extends VanComponent {}
|
export class Collapse extends VanComponent {}
|
||||||
@ -88,6 +88,8 @@ export class Uploader extends VanComponent {}
|
|||||||
export {
|
export {
|
||||||
AddressEdit,
|
AddressEdit,
|
||||||
Area,
|
Area,
|
||||||
|
Checkbox,
|
||||||
|
CheckboxGroup,
|
||||||
Dialog,
|
Dialog,
|
||||||
ImagePreview,
|
ImagePreview,
|
||||||
Lazyload,
|
Lazyload,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user