mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-02 06:17:48 +00:00
Use separate routes instead of anchors (#4285)
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user