Finished logic
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -31,7 +31,7 @@ function entryHasExamples() {
|
||||
</p>
|
||||
</span>
|
||||
|
||||
<h4 class="text-xl mt-4 mb-2 font-bold">Arguments</h4>
|
||||
<h4 v-if="entryHasArguments()" class="text-xl mt-4 mb-2 font-bold">Arguments</h4>
|
||||
<table v-if="entryHasArguments()" class="w-full">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@@ -46,8 +46,8 @@ function entryHasExamples() {
|
||||
</table>
|
||||
<strong>Output: </strong>{{ props.entryData.output }}
|
||||
|
||||
<h4 class="text-xl mt-4 mb-2 font-bold">Example</h4>
|
||||
<table class="w-full">
|
||||
<h4 v-if="entryHasExamples()" class="text-xl mt-4 mb-2 font-bold">Example</h4>
|
||||
<table v-if="entryHasExamples()" class="w-full">
|
||||
<tr>
|
||||
<th>Command</th>
|
||||
<th>Output</th>
|
||||
|
||||
Reference in New Issue
Block a user