import { _decorator, Component, Label, Node } from 'cc'; const { ccclass, property } = _decorator; @ccclass('toast') export class toast extends Component { @property(Node) lab_name:Node = null; remove_self(){ // console.log("remove_self") this.node.removeFromParent(); } public showView(text:string){ if(this.lab_name!=null){ this.lab_name.getComponent(Label).string = text; } } }