mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
Refactor: Simplify Vue app mounting and enhance callback handling
This commit is contained in:
parent
78ac0be8d0
commit
1ce13672ec
1 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,7 @@ export function loadContent(contentElement, htmlPath, callback) {
|
|||
app.use(I18NextVue, { i18next });
|
||||
|
||||
// Mount the app to this element and store the instance
|
||||
const mountedApp = app.mount(el[0]);
|
||||
app.mount(el[0]);
|
||||
console.log(
|
||||
`${logHead} Mounted Vue app ${index + 1}/${vueElements.length} on element with data-vue attribute`,
|
||||
);
|
||||
|
@ -60,7 +60,7 @@ export function loadContent(contentElement, htmlPath, callback) {
|
|||
|
||||
// Call the original callback (success case)
|
||||
if (callback) {
|
||||
callback();
|
||||
callback(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ function unmountVueApps(contentElement) {
|
|||
}
|
||||
});
|
||||
// Clear the stored apps
|
||||
vueAppInstances.set(contentElement[0], []);
|
||||
vueAppInstances.delete(contentElement[0]);
|
||||
console.log(`${logHead} Cleared Vue app instances from container`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue