Browse Source

fix: avoid multiple meta api request

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3342/head
Pranav C 2 years ago
parent
commit
096ea7289b
  1. 9
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index.vue
  2. 9
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/[type]/[title]/[[viewTitle]].vue

9
packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index.vue

@ -7,19 +7,11 @@ import MdiView from '~icons/mdi/eye-circle-outline'
import MdiAccountGroup from '~icons/mdi/account-group'
const { tabs, activeTabIndex, activeTab, closeTab } = useTabs()
const { getMeta } = useMetas()
const { isLoading } = useGlobal()
provide(TabMetaInj, activeTab)
watch(
() => activeTab?.value?.id,
async () => {
await getMeta(activeTab?.value?.id as string, true)
},
{ immediate: true },
)
const icon = (tab: TabItem) => {
switch (tab.type) {
@ -101,6 +93,7 @@ function onEdit(targetKey: number, action: 'add' | 'remove' | string) {
.ant-tabs-nav-add {
@apply !hidden;
}
.ant-tabs-nav-more {
@apply text-white;
}

9
packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/[type]/[title]/[[viewTitle]].vue

@ -1,7 +1,8 @@
<script>
export default {
name: 'Index',
}
<script setup lang="ts">
const { getMeta } = useMetas()
const route = useRoute()
await getMeta(route.params.title as string, true)
</script>
<template>

Loading…
Cancel
Save