Could someone assist me in converting this vue wrapper to be compatible with Vue3? I have attempted it myself, but the components that I try to render using my buildApp method are not appearing. Is there an alternative for the Vue object imported from vue in vue3?
import Vue from 'vue';
import HttpServiceFactory from '@/api/HttpServiceFactory';
import { TranslationHelper } from '@/utils/mixins/Translations';
import { PermissionsHelper } from '@/utils/mixins/Permissions';
import HttpClient from '@/utils/http/HttpService';
import ApplicationConfig from '@/config/ApplicationConfig';
import ParentAccessorHelper from '@/src/helpers/plugins/ParentAccessorHelper';
import VueRouter from 'vue-router';
import * as UtilityComponents from './utils/import';
Object.entries(UtilityComponents).forEach(([componentName, componentExport]) => {
Vue.component(componentName, componentExport);
});
Vue.buildApp = ({ layoutId, routes = null, rootData = {} }) => {
Vue.use(VueRouter);
if (routes === null) {
return new Vue({
data() {
return {
...rootData,
};
},
}).$mount(`#${layoutId}`);
}
const router = createRouter({
history: createWebHistory(),
routes,
});
const app = createApp({
data() {
return {
isAppLoading: true,
...rootData,
};
},
}).use(router).mount(`#${layoutId}`);
router.beforeEach((to, from, next) => {
app.isAppLoading = true;
next();
});
router.afterEach(() => {
app.isAppLoading = false;
});
return app;
};
export default Vue;