hbuilderx-extension-docs icon indicating copy to clipboard operation
hbuilderx-extension-docs copied to clipboard

asWebviewUri文档和代码不符,并且通过webView无法调用该方法

Open Cone1989 opened this issue 2 years ago • 1 comments

文档描述如下: WeChat70fbff57c3bd6c1c853c0d4e0abe1433

代码如下:

interface WebView {
    ...
    /**
     * 将本地资源转换成可在WebView中加载的Uri。
     */
    asWebviewUri(Uri: Uri): void;
}

代码中该方法没有返回值。

另外,在代码中调用的时候:

resolveCustomEditor(document, webViewPanel) {
	console.log(webViewPanel.webView)
	console.log(webViewPanel.webView.asWebviewUri)
}

打印如下:

// webView有值
WebView {
 _id: 'customeditor.htmlEdit.html.1',
_msgListeners: [],
 _html: ''

// webView.asWebviewUri为undefined
undefined

这两个问题是怎么回事?是我的版本有问题吗? 我的环境是macOS 12.3,HBuilderX版本为:3.6.15.20221228

Cone1989 avatar Jan 03 '23 11:01 Cone1989

我也遇到了上面的问题,您这边解决了吗

gaoshengqing21 avatar Dec 13 '23 11:12 gaoshengqing21