🎨 Support HarmonyOS NEXT system
This commit is contained in:
parent
9693adb9e7
commit
e58a869e0e
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
export const addScriptSync = (path: string, id: string) => {
|
||||
export const addScriptSync = async (path: string, id: string) => {
|
||||
if (document.getElementById(id)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -12,6 +12,10 @@ export const addScriptSync = (path: string, id: string) => {
|
|||
scriptElement.text = xhrObj.responseText;
|
||||
scriptElement.id = id;
|
||||
document.head.appendChild(scriptElement);
|
||||
if (typeof Lute === "undefined") {
|
||||
// 鸿蒙系统上第一次加载会出现 Lute 未定义的情况,重新载入一次就好了,暂时没找到原因,先这样处理
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
export const addScript = (path: string, id: string) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue