Files
web/app/plugins/03-api-loader.js
2026-06-15 09:47:39 +07:00

22 lines
498 B
JavaScript

export default defineNuxtPlugin((nuxtApp) => {
const store = useStore();
const { $getapi, $readyapi } = nuxtApp;
const connlist = $readyapi([
"common",
"tablesetting",
"datatype",
"settingtype",
"settingclass",
"colorchoice",
"menuchoice",
"colorscheme",
]);
const notReadyConns = connlist.filter((v) => !v.ready);
async function getReady() {
await $getapi(notReadyConns);
store.ready = true;
}
if (notReadyConns.length > 0) getReady();
});