feat: 支持 PK 数据以及详情页面
This commit is contained in:
32
assets/prefabs/PagePKData.ts
Normal file
32
assets/prefabs/PagePKData.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { _decorator, Node, Button } from 'cc';
|
||||
import { BaseView } from 'db://assets/scripts/core/BaseView';
|
||||
import { ViewManager } from 'db://assets/scripts/core/ViewManager';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PagePKData')
|
||||
export class PagePKData extends BaseView {
|
||||
@property({ type: Node, tooltip: '返回按钮' })
|
||||
backBtn: Node | null = null;
|
||||
|
||||
onViewLoad(): void {
|
||||
if (this.backBtn) {
|
||||
this.backBtn.on(Button.EventType.CLICK, this._onBackClick, this);
|
||||
}
|
||||
}
|
||||
|
||||
onViewShow(): void {
|
||||
}
|
||||
|
||||
onViewHide(): void {
|
||||
}
|
||||
|
||||
private _onBackClick(): void {
|
||||
ViewManager.instance.back();
|
||||
}
|
||||
|
||||
onViewDestroy(): void {
|
||||
if (this.backBtn) {
|
||||
this.backBtn.off(Button.EventType.CLICK, this._onBackClick, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user