uniapp的webview中如何获取webview实例:app-plus模式

以下是app-plus下

getWebviewInstance() {
      // #ifdef APP-PLUS
      const currentWebview = this.$scope.$getAppWebview();
      if (currentWebview) {
        const children = currentWebview.children();
        if (children && children.length > 0) {
          this.webview = children[0];
          console.log('获取到WebView实例:', this.webview);
        }
      }
      // #endif
    },

Comments

No comments yet. Why don’t you start the discussion?

发表回复