mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
666 B
37 lines
666 B
2 years ago
|
<template>
|
||
|
<div>
|
||
|
<template v-if="meta && tabMeta">
|
||
|
<SmartsheetGrid :meta="meta" :tabMeta="tabMeta"></SmartsheetGrid>
|
||
|
</template>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script setup lang="ts">
|
||
|
import {useMetas} from "~/composables/metas";
|
||
|
import {computed, onMounted, watch} from 'vue'
|
||
|
|
||
|
const {tabMeta} = defineProps({
|
||
|
tabMeta: Object
|
||
|
})
|
||
|
|
||
|
const {getMeta, metas} = useMetas()
|
||
|
|
||
|
const meta = computed(() => {
|
||
|
return metas.value?.[tabMeta?.id]
|
||
|
})
|
||
|
|
||
|
onMounted(async () => {
|
||
|
await getMeta(tabMeta?.id)
|
||
|
})
|
||
|
|
||
|
watch(() => tabMeta && tabMeta?.id, async (newVal, oldVal) => {
|
||
|
if (newVal !== oldVal) {
|
||
|
await getMeta(newVal)
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
</style>
|