fix error when method and onLoad have params (#35339)

This commit is contained in:
strange-fish 2019-05-15 04:23:57 +08:00 committed by Nathan Shively-Sanders
parent a1302810f3
commit 14effc6d16
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
// Type definitions for @tinajs/tina 1.4
// Project: https://github.com/tinajs/tina, https://tina.js.org
// Definitions by: Jiayu Liu <https://github.com/Jimexist>
// Strange Fish <https://github.com/strange-fish>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tinajs__tina
// TypeScript Version: 2.2
@ -22,7 +23,7 @@ export interface ComponentDefinitions extends ComponentLifecycles {
properties: ComponentProperties;
data: { [key: string]: any };
compute: (data: { [key: string]: any }) => { [key: string]: any };
methods: { [name: string]: (this: Component) => any };
methods: { [name: string]: (this: Component, ...args: any[]) => any };
mixins: Array<Partial<ComponentDefinitions>>;
}
@ -35,7 +36,7 @@ export class Component {
export interface PageHooks {
beforeLoad: (this: Page) => void;
onLoad: (this: Page) => void;
onLoad: (this: Page, options?: any) => void;
onReady: (this: Page) => void;
onShow: (this: Page) => void;
onHide: (this: Page) => void;

View File

@ -46,7 +46,7 @@ Page.define({
this.data.count;
},
methods: {
handleTapButton() {
handleTapButton(event) {
this.data.count;
}
}