adapting vuejs form for accompanyingPeriodWork: include template for

specific evaluation
This commit is contained in:
2021-12-03 20:09:24 +01:00
parent a86ba6faf5
commit 2d319fcc42
8 changed files with 224 additions and 139 deletions

View File

@@ -1,24 +1,27 @@
import {createApp} from 'vue';
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
import {fetchTemplates} from 'ChillDocGeneratorAssets/api/pickTemplate.js';
import {_createI18n} from 'ChillMainAssets/vuejs/_js/i18n';
const i18n = _createI18n({});
document.querySelectorAll('div[data-docgen-template-picker]').forEach(el => {
let
picker = {
template: '<pick-template :entityClass="this.entityClass" :entityId="this.entityId"></pick-template>',
components: {
PickTemplate,
},
data() {
return {
entityClass: el.dataset.entityClass,
entityId: el.dataset.entityId,
}
},
}
;
fetchTemplates(el.dataset.entityClass).then(templates => {
let
picker = {
template: '<pick-template :templates="this.templates" :entityId="this.entityId"></pick-template>',
components: {
PickTemplate,
},
data() {
return {
templates: templates,
entityId: el.dataset.entityId,
}
},
}
;
createApp(picker).use(i18n).mount(el);
})
createApp(picker).use(i18n).mount(el);
});