felicity-lims/webapp/views/client/_id/ClientDetail.vue

43 lines
1.2 KiB
Vue
Raw Normal View History

2022-04-15 16:32:24 +08:00
<script setup lang="ts">
import { ref, computed } from "vue";
import { useClientStore } from "../../../stores";
import tabSamples from "../../components/SampleListing.vue";
import tabContacts from "../comps/ContactTable.vue";
2022-04-15 16:32:24 +08:00
const clientStore = useClientStore();
2022-04-15 16:32:24 +08:00
let currentTab = ref("samples");
const tabs = ["samples", "contacts"];
let currentTabComponent = computed(() => "tab-" + currentTab.value);
2022-04-15 16:32:24 +08:00
let client = computed(() => clientStore.getClient);
2022-04-15 16:32:24 +08:00
</script>
2021-05-07 01:32:14 +08:00
<template>
<section class="col-span-12">
2022-12-22 22:42:05 +08:00
<nav class="bg-white shadow-md mt-2">
<div class="-mb-px flex justify-start">
<a
v-for="tab in tabs"
:key="tab"
:class="[
2023-03-12 21:06:37 +08:00
'no-underline text-gray-500 uppercase tracking-wide font-bold text-xs py-1 px-4 tab hover:bg-sky-600 hover:text-gray-200',
{ 'tab-active': currentTab === tab },
]"
@click="currentTab = tab"
href="#"
>
{{ tab }}
</a>
</div>
</nav>
2023-02-26 22:14:43 +08:00
<div class="pt-4">
<tab-samples v-if="currentTab === 'samples'" />
<tab-contacts v-if="currentTab === 'contacts'" :clientUid="client?.uid" />
2021-05-07 01:32:14 +08:00
</div>
</section>
2021-05-07 01:32:14 +08:00
</template>
<style lang="postcss"></style>