Merge pull request #26724 from Jimexist/update-wepy

add .use method to wepy app
This commit is contained in:
Nathan Shively-Sanders
2018-06-21 14:14:35 -07:00
committed by GitHub
2 changed files with 26 additions and 1 deletions
+20 -1
View File
@@ -8,6 +8,25 @@ export interface AppConstructor {
new (): app;
}
/* the supported add-ons */
export type AddOn = "requestfix" | "promisify";
export interface WindowConfig {
backgroundTextStyle: string;
navigationBarBackgroundColor: string;
navigationBarTitleText: string;
navigationBarTextStyle: string;
}
export default class app {
$init(wepy: any, config: AppConfig): any;
config: {
window: WindowConfig;
pages: string[];
};
$init(wepy: any, config: AppConfig): void;
use(addonName: AddOn, ...args: any[]): void;
$initAPI(
wepy: any,
noPromiseAPI: string[] | { [name: string]: boolean }
): void;
}
+6
View File
@@ -1,5 +1,11 @@
import wepy from "wepy";
export class MyApp extends wepy.app {
async onLoad() {
this.use("requestfix");
}
}
export class MyComponent extends wepy.component {
data = {
reveal: false,