import { SuperPage } from '../super/page'; import { toObject } from '../utils/object'; export function wxPage() { return function (constructor: new () => SuperPage): void { class WxPage extends constructor { storeBindings: any; // eslint-disable-next-line @typescript-eslint/no-unused-vars constructor(..._args: any[]) { super(); } onLoad(options?: any) { super.onLoad && super.onLoad(options); } onReady() { super.onReady && super.onReady(); } onShow() { super.onShow && super.onShow(); } onUnload() { super.onUnload && super.onUnload(); } } const current = new WxPage(); const obj = toObject(current); Page(obj); }; }