Finished logic

This commit is contained in:
2023-06-26 14:29:07 +02:00
parent 1088d27fea
commit 1229abc0b9
6 changed files with 41 additions and 15 deletions

View File

@@ -4,9 +4,24 @@ import tooltipCategoryComponent from '@components/xml/tooltips/TooltipCategoryCo
import tooltipEntryComponent from '@components/xml/tooltips/TooltipEntryComponent.vue'
import xpath1 from '@assets/tooltips/xpath/xpath1.json'
import xpath2 from '@assets/tooltips/xpath/xpath1.json'
import xpath2 from '@assets/tooltips/xpath/xpath2.json'
import { watch } from 'vue';
const props = defineProps({
version: {
type: String,
required: true
}
})
const areTooltipsHidden = ref(true)
function selectXPathVersion() {
if (props.version == "1.0") {
return xpath1;
}
else return xpath2;
}
function toggleTooltips() {
areTooltipsHidden.value = !areTooltipsHidden.value;
@@ -20,7 +35,7 @@ function toggleTooltips() {
T<br/>o<br/>o<br/>l<br/>t<br/>i<br/>p<br/>s
</button>
<div id="content" :class="{'hidden' : areTooltipsHidden}" class="w-full flex flex-col gap-4 p-2 overflow-scroll rounded-xl dark:text-white bg-indigo-50 dark:bg-slate-800" >
<tooltipCategoryComponent v-for="category in xpath1" :name="category.name">
<tooltipCategoryComponent v-for="category in selectXPathVersion()" :name="category.name">
<tooltipEntryComponent v-for="entry in category.entries" :entry-data="entry"></tooltipEntryComponent>
</tooltipCategoryComponent>
</div>