Use separate routes instead of anchors (#4285)

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
qwerty287
2024-11-19 15:04:50 +02:00
committed by GitHub
parent 5c2204716c
commit 95e464b7cd
39 changed files with 339 additions and 369 deletions

View File

@@ -18,8 +18,6 @@
</template>
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import Container from '~/components/layout/Container.vue';
import { useTabsProvider } from '~/compositions/useTabs';
@@ -33,37 +31,16 @@ const props = defineProps<{
// Tabs
enableTabs?: boolean;
disableTabUrlHashMode?: boolean;
activeTab?: string;
// Content
fluidContent?: boolean;
}>();
const emit = defineEmits<{
(event: 'update:activeTab', value: string | undefined): void;
defineEmits<{
(event: 'update:search', value: string): void;
}>();
if (props.enableTabs) {
const internalActiveTab = ref(props.activeTab);
watch(
() => props.activeTab,
(activeTab) => {
internalActiveTab.value = activeTab;
},
);
useTabsProvider({
activeTab: computed({
get: () => internalActiveTab.value,
set: (value) => {
internalActiveTab.value = value;
emit('update:activeTab', value);
},
}),
disableUrlHashMode: computed(() => props.disableTabUrlHashMode || false),
});
useTabsProvider();
}
</script>