types(DropdownItem): add toggle method type
This commit is contained in:
@@ -56,6 +56,7 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// @exposed-api
|
||||||
toggle(show = !this.showPopup, options = {}) {
|
toggle(show = !this.showPopup, options = {}) {
|
||||||
if (show === this.showPopup) {
|
if (show === this.showPopup) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export default {
|
|||||||
|
|
||||||
| 方法名 | 说明 | 参数 | 返回值 |
|
| 方法名 | 说明 | 参数 | 返回值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| toggle | 切换菜单是否展示 | show: boolean | - |
|
| toggle | 切换菜单展示状态,传`true`为显示,`false`为隐藏,不传参为取反 | show?: boolean | - |
|
||||||
|
|
||||||
### Option 数据结构
|
### Option 数据结构
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { VanComponent } from './component';
|
||||||
|
|
||||||
|
export class DropdownItem extends VanComponent {
|
||||||
|
toggle(show?: boolean): void;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user