mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
load vue banner component for each page of AccompanyingCourse context
* vue css and js loaded from layout.html.twig * rename 'show' template to 'edit' template * overwrite js block for 'edit' template (load all component, not only banner)
This commit is contained in:
@@ -4,20 +4,47 @@ import { appMessages } from './js/i18n'
|
||||
import { initPromise } from './store'
|
||||
|
||||
import App from './App.vue';
|
||||
import Banner from './components/Banner.vue';
|
||||
|
||||
initPromise.then(store => {
|
||||
const root = window.vueRootComponent;
|
||||
|
||||
//console.log('store in create_store', store);
|
||||
//console.log('store accompanyingCourse', store.state.accompanyingCourse);
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount('#accompanying-course');
|
||||
/*
|
||||
* Load all App component, for AccompanyingCourse edition page
|
||||
*/
|
||||
if (root === 'app') {
|
||||
|
||||
});
|
||||
initPromise.then(store => {
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount('#accompanying-course');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Load only Banner sub-component, for all others AccompanyingCourse page
|
||||
*/
|
||||
if (root === 'banner') {
|
||||
|
||||
initPromise.then(store => {
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<banner></banner>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.component('banner', Banner)
|
||||
.mount('#accompanying-course');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user