feat: tab service added (#3367)

This commit is contained in:
Anwarul Islam
2023-10-11 18:51:07 +06:00
committed by GitHub
parent 51510566bc
commit ba31cdabea
60 changed files with 1112 additions and 841 deletions

View File

@@ -1,36 +1,33 @@
<template>
<div class="flex flex-col flex-1 relative">
<HttpResponseMeta :response="tab.response" />
<HttpResponseMeta :response="doc.response" />
<LensesResponseBodyRenderer
v-if="!loading && hasResponse"
v-model:selected-tab-preference="selectedTabPreference"
v-model:tab="tab"
v-model:document="doc"
/>
</div>
</template>
<script setup lang="ts">
import { computed, ref } from "vue"
import { HoppRESTTab } from "~/helpers/rest/tab"
import { useVModel } from "@vueuse/core"
import { computed } from "vue"
import { HoppRESTDocument } from "~/helpers/rest/document"
const props = defineProps<{
tab: HoppRESTTab
document: HoppRESTDocument
}>()
const emit = defineEmits<{
(e: "update:tab", val: HoppRESTTab): void
(e: "update:tab", val: HoppRESTDocument): void
}>()
const tab = useVModel(props, "tab", emit)
const selectedTabPreference = ref<string | null>(null)
const doc = useVModel(props, "document", emit)
const hasResponse = computed(
() =>
tab.value.response?.type === "success" ||
tab.value.response?.type === "fail"
doc.value.response?.type === "success" ||
doc.value.response?.type === "fail"
)
const loading = computed(() => tab.value.response?.type === "loading")
const loading = computed(() => doc.value.response?.type === "loading")
</script>