feat: refs #8197 default sectionName

This commit is contained in:
Alex Moreno 2024-12-18 13:04:00 +01:00
parent 66d0c2d5bb
commit b54f39f1a0
1 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import RightMenu from './RightMenu.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnTableFilter from '../VnTable/VnTableFilter.vue';
import { onBeforeMount } from 'vue';
import { onBeforeMount, computed } from 'vue';
import { useArrayData } from 'src/composables/useArrayData';
const $props = defineProps({
@ -36,6 +36,8 @@ const $props = defineProps({
},
});
const sectionValue = computed(() => $props.section ?? $props.dataKey);
onBeforeMount(() => {
if ($props.dataKey)
useArrayData($props.dataKey, {
@ -67,6 +69,6 @@ onBeforeMount(() => {
</template>
</RightMenu>
<slot name="body" v-if="section == $route.name" />
<slot name="body" v-if="sectionValue == $route.name" />
<RouterView v-else />
</template>