import { _decorator, Component, Node, WebView } from 'cc'; const { ccclass, property } = _decorator; @ccclass('WebWindow') export class WebWindow extends Component { @property({ type: WebView, tooltip: "网页" }) web: WebView; public onParams(type: string): void { let url = ""; switch (type) { case "1": url = "http://happyfam-oss.mokamrp.com/page/yhxy.html"; break; case "2": url = "http://happyfam-oss.mokamrp.com/page/yszc.html"; break; } this.web.url = url; } }