<template>
  <component :is="currentComponent" />
</template>

<script>
import { defineComponent, computed } from 'vue';
import { useRoute } from 'vue-router';
import NewDesign from '@/end/NewDesign.vue';
import NewStyleDesign from '@/endnew/NewStyleDesign.vue';
import NodataView from '@/end/NodataView.vue';

export default defineComponent({
  setup() {
    const route = useRoute();

    const currentComponent = computed(() => {
      // 根据路由参数动态加载组件
      if (route.params.type === 'vertical') {
        return NewDesign;
      } else if (route.params.type === 'grid') {
        return NewStyleDesign;
      }
      // 默认加载的组件
      return NewDesign;
    });

    return {
      currentComponent
    };
  }
});
</script>