Skip to content

Commit

Permalink
remove tabs model and introduce it to resultview
Browse files Browse the repository at this point in the history
  • Loading branch information
crsct authored and lukasjelonek committed Aug 30, 2023
1 parent 9ef74ae commit 5c028eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
19 changes: 3 additions & 16 deletions src/components/Pane.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<script setup lang="ts">
import type { Tab } from "@/model/Tabs";
import PaneTab from "@/components/PaneTab.vue";
import type { Tab } from "@/views/show-results/ResultView.vue";
import Panetab from "./PaneTab.vue";
import type { PropType } from "vue";
type Action = {
title: string;
href: object;
};
defineProps({
activeItem: { type: String },
items: { type: Array as PropType<Array<Tab>>, required: true },
action: { type: Object as PropType<Action>, required: true },
});
const emits = defineEmits(["update:value"]);
Expand All @@ -21,14 +15,7 @@ const emits = defineEmits(["update:value"]);
<!-- Tabbed Navigation -->
<div class="shadow-sm p-4">
<ul class="nav nav-pills py-3">
<PaneTab @click="$emit('update:value', item.id)" :tab="item" :active="activeItem == item.id" v-for="item in items" :key="item.id" />

<slot name="action">
<li class="ms-auto" v-if="action">
<!-- @TODO: Figure out how to directly download an entry, json? -->
<a class="btn btn-primary" href="#">{{ action.title }}</a>
</li>
</slot>
<Panetab @click="$emit('update:value', item.id)" :tab="item" :active="activeItem == item.id" v-for="item in items" :key="item.id" />>
</ul>
<div class="tab-content">
<slot></slot>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PaneTab.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { Tab } from '@/model/Tabs';
import type { Tab } from '@/views/show-results/ResultView.vue'
import type { PropType } from 'vue';
defineProps({
Expand All @@ -10,6 +10,6 @@ defineProps({

<template>
<li class="nav-item">
<a class="nav-link" :class="{ active }" href="#">{{ tab.title }}</a>
<a class="nav-link" :class="{ active }" href="#">{{ tab.name }}</a>
</li>
</template>

0 comments on commit 5c028eb

Please sign in to comment.