mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 14:32:18 +00:00
work in progess, calc tabs title suffix when component is not rendered
This commit is contained in:
@@ -68,7 +68,8 @@ class Config extends FHCAPI_Controller
|
||||
'title' => $this->p->t('stv', 'tab_notes'),
|
||||
'component' => './Stv/Studentenverwaltung/Details/Notizen.js',
|
||||
'config' => $config['notes'],
|
||||
'showSuffix' => $showSuffix && ($config['notes']['showCountNotes'] ?? false)
|
||||
'showSuffix' => $showSuffix && ($config['notes']['showCountNotes'] ?? false),
|
||||
'suffixhelper' => APP_ROOT . 'public/js/components/Stv/Studentenverwaltung/Details/Notizen/NotizenSuffixHelper.js'
|
||||
];
|
||||
|
||||
$result['contact'] = [
|
||||
|
||||
@@ -517,6 +517,9 @@ export default {
|
||||
});
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getSuffix() {
|
||||
return '(bhtest)';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -67,9 +67,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTabClick: function(index) {
|
||||
handleTabClick: function (e) {
|
||||
let keys = Object.keys(this.tabs);
|
||||
this.change(keys[index]);
|
||||
this.change(keys[e.index]);
|
||||
},
|
||||
change(key) {
|
||||
this.$emit("change", key)
|
||||
@@ -108,8 +108,24 @@ export default {
|
||||
title: Vue.computed(() => item.title || key),
|
||||
config: item.config,
|
||||
key,
|
||||
value
|
||||
value,
|
||||
suffixhelper: null
|
||||
};
|
||||
|
||||
const fetchhelper = async function (tab, item) {
|
||||
if (!item.showSuffix)
|
||||
return null;
|
||||
|
||||
const mod = await import(item.suffixhelper);
|
||||
tab.suffixhelper = mod.getSuffix;
|
||||
// TODO call suffixhelper with modelValue - but modelValue not defined in this scope
|
||||
/*
|
||||
tab.suffixhelper(modelValue).then((response) => {
|
||||
tab.value.suffix = response.data;
|
||||
});
|
||||
*/
|
||||
};
|
||||
fetchhelper(tabs[key], item);
|
||||
}
|
||||
|
||||
if (Array.isArray(config))
|
||||
|
||||
Reference in New Issue
Block a user