如果使用的是har中的资源,不能使用setUIContent,需要使用LoadContentByName(命名路由)。命名路由配置可参考router中命名路由配置,参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-routing-V5\#%E5%91%BD%E5%90%8D%E8%B7%AF%E7%94%B1其中路由名称即LoadContentByName的第一个参数,其他参数设置参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5\#loadcontentbyname11
如果使用的是har中的资源,不能使用setUIContent,需要使用LoadContentByName(命名路由)。命名路由配置可参考router中命名路由配置,参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-routing-V5\#%E5%91%BD%E5%90%8D%E8%B7%AF%E7%94%B1
其中路由名称即LoadContentByName的第一个参数,其他参数设置参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5\#loadcontentbyname11