import { _decorator, Component, Node } from 'cc';
import JNLayerBase from '../../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
import { app } from '../../../App';
import { Label } from 'cc';
const { ccclass, property } = _decorator;

export interface TipsArgs{
    text?:string; //内容
    time?:number; //显示时间
}

@ccclass('TipsView')
export class TipsView extends JNLayerBase {

    @property(Label)
    text:Label;

    onJNLoad(data: TipsArgs = {}): void {
        if(!data) data = {};
        
        data.text = data.text || "这是一个提示";
        data.time = data.time || 3;

        //显示弹窗内容
        this.text.string = data.text;

        this.scheduleOnce(() => {
            this.onJNClose();
        },data.time)

    }

}