Lv110版本源码上传
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { ipcRenderer } from "electron"
|
||||
import { useLoading } from "./loading"
|
||||
|
||||
const { appendLoading, removeLoading } = useLoading()
|
||||
window.removeLoading = removeLoading
|
||||
window.pywebview = {
|
||||
api: ipcRenderer
|
||||
}
|
||||
// window.sharedObject = {
|
||||
// storage: "test"
|
||||
// }
|
||||
|
||||
/** docoment ready */
|
||||
function domReady(condition: DocumentReadyState[] = ["complete", "interactive"]) {
|
||||
return new Promise(resolve => {
|
||||
if (condition.includes(document.readyState)) {
|
||||
resolve(true)
|
||||
} else {
|
||||
document.addEventListener("readystatechange", () => {
|
||||
if (condition.includes(document.readyState)) {
|
||||
resolve(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
domReady().then(appendLoading)
|
||||
Reference in New Issue
Block a user