WebWindow.ts 602 B

123456789101112131415161718192021
  1. import { _decorator, Component, Node, WebView } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('WebWindow')
  4. export class WebWindow extends Component {
  5. @property({ type: WebView, tooltip: "网页" }) web: WebView;
  6. public onParams(type: string): void {
  7. let url = "";
  8. switch (type) {
  9. case "1":
  10. url = "http://happyfam-oss.mokamrp.com/page/yhxy.html";
  11. break;
  12. case "2":
  13. url = "http://happyfam-oss.mokamrp.com/page/yszc.html";
  14. break;
  15. }
  16. this.web.url = url;
  17. }
  18. }