|
|
@ -1,29 +1,29 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { watch } from "vue"; |
|
|
|
import { watch } from 'vue' |
|
|
|
import useProject from "~/composables/useProject"; |
|
|
|
import useProject from '~/composables/useProject' |
|
|
|
import useTabs from "~/composables/useTabs"; |
|
|
|
import useTabs from '~/composables/useTabs' |
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
const route = useRoute() |
|
|
|
const { loadProject, loadTables } = useProject(); |
|
|
|
const { loadProject, loadTables } = useProject() |
|
|
|
const { clearTabs } = useTabs(); |
|
|
|
const { clearTabs } = useTabs() |
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
onMounted(async () => { |
|
|
|
await loadProject(route.params.projectId as string); |
|
|
|
await loadProject(route.params.projectId as string) |
|
|
|
await loadTables(); |
|
|
|
await loadTables() |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => route.params.projectId, |
|
|
|
() => route.params.projectId, |
|
|
|
async (newVal, oldVal) => { |
|
|
|
async (newVal, oldVal) => { |
|
|
|
if (newVal !== oldVal) { |
|
|
|
if (newVal !== oldVal) { |
|
|
|
clearTabs(); |
|
|
|
clearTabs() |
|
|
|
if (newVal) { |
|
|
|
if (newVal) { |
|
|
|
await loadProject(newVal as string); |
|
|
|
await loadProject(newVal as string) |
|
|
|
await loadTables(); |
|
|
|
await loadTables() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
); |
|
|
|
) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|