mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-08-26 15:01:18 +08:00
feat: improvement to template
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
if (condition.includes(document.readyState)) {
|
||||
resolve(true)
|
||||
} else {
|
||||
@@ -85,7 +85,7 @@ function useLoading() {
|
||||
const { appendLoading, removeLoading } = useLoading()
|
||||
domReady().then(appendLoading)
|
||||
|
||||
window.onmessage = ev => {
|
||||
window.onmessage = (ev) => {
|
||||
ev.data.payload === 'removeLoading' && removeLoading()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user