HarmonyOS web加载沙盒路径下的index.html文件后面还有其他参数需要拼接,如何编写代码?

如题:HarmonyOS web加载沙盒路径下的index.html文件后面还有其他参数需要拼接,如何编写代码?

阅读 421
1 个回答

可以通过

Web({src: 'file://${沙箱路径}#/main?networkState=1', controller: this.controller}) 

在h5中通过window.location.hash可以获取到 \#/main?networkState=1"。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进