feat: refs #8197 default sectionName
This commit is contained in:
parent
66d0c2d5bb
commit
b54f39f1a0
|
@ -2,7 +2,7 @@
|
||||||
import RightMenu from './RightMenu.vue';
|
import RightMenu from './RightMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||||
import { onBeforeMount } from 'vue';
|
import { onBeforeMount, computed } from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -36,6 +36,8 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
if ($props.dataKey)
|
if ($props.dataKey)
|
||||||
useArrayData($props.dataKey, {
|
useArrayData($props.dataKey, {
|
||||||
|
@ -67,6 +69,6 @@ onBeforeMount(() => {
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
|
|
||||||
<slot name="body" v-if="section == $route.name" />
|
<slot name="body" v-if="sectionValue == $route.name" />
|
||||||
<RouterView v-else />
|
<RouterView v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue