HarmonyOS web无法加载html?

html无法正确加载,如何解决呢?

阅读 445
1 个回答

loadData加载指定的数据 把接口返回的数据转成string即可。

Web({ src: '', controller: this.controller })
  .onControllerAttached(() => {
    this.controller.loadData(this.webContent, "text/html", "UTF-8", 'xxx')
  })