mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-14 14:50:50 +08:00
21 lines
578 B
Vue
21 lines
578 B
Vue
<template>
|
|
<component :is="componentToUse" v-bind="$attrs" ref="musicFullRef" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
import { isMobile } from '@/utils';
|
|
import MusicFull from '@/components/lyric/MusicFull.vue';
|
|
import MusicFullMobile from '@/components/lyric/MusicFullMobile.vue';
|
|
|
|
// 根据当前设备类型选择需要显示的组件
|
|
const componentToUse = computed(() => {
|
|
return isMobile.value ? MusicFullMobile : MusicFull;
|
|
});
|
|
|
|
const musicFullRef = ref<InstanceType<typeof MusicFull>>();
|
|
|
|
defineExpose({
|
|
musicFullRef
|
|
});
|
|
</script> |