2023-11-29 09:34:45 +00:00
|
|
|
<template>
|
2024-05-20 09:50:14 +00:00
|
|
|
<component :is="currentTemplate" :key="route.fullPath" />
|
2023-11-29 09:34:45 +00:00
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2024-05-20 09:50:14 +00:00
|
|
|
import { onMounted, computed } from 'vue'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
const components: any = import.meta.glob('@/views/chat/**/index.vue', {
|
|
|
|
|
eager: true
|
|
|
|
|
})
|
2023-11-30 10:50:42 +00:00
|
|
|
const route = useRoute()
|
|
|
|
|
const {
|
2024-05-20 09:50:14 +00:00
|
|
|
query: { mode }
|
2023-11-30 10:50:42 +00:00
|
|
|
} = route as any
|
|
|
|
|
|
2024-05-20 09:50:14 +00:00
|
|
|
const currentTemplate = computed(() => {
|
|
|
|
|
const name = `/src/views/chat/${mode || 'pc'}/index.vue`
|
|
|
|
|
return components[name].default
|
2023-11-30 10:50:42 +00:00
|
|
|
})
|
2024-05-15 02:26:49 +00:00
|
|
|
|
2024-05-20 09:50:14 +00:00
|
|
|
onMounted(() => {})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss"></style>
|