🎈 perf: 添加自动导入,优化性能

This commit is contained in:
alger
2023-12-27 14:40:22 +08:00
parent 70139e3ca4
commit 6c57e77969
29 changed files with 268 additions and 128 deletions
-1
View File
@@ -16,7 +16,6 @@
</template>
<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';
const RecommendSinger = defineAsyncComponent(() => import("@/components/RecommendSinger.vue"));
const PlaylistType = defineAsyncComponent(() => import("@/components/PlaylistType.vue"));
const RecommendSonglist = defineAsyncComponent(() => import("@/components/RecommendSonglist.vue"));
+1 -3
View File
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import { getRecommendList, getListDetail, getListByCat } from '@/api/list'
import { ref, watch } from 'vue';
import type { IRecommendItem } from "@/type/list";
import type { IListDetail } from "@/type/listDetail";
import { setAnimationClass, setAnimationDelay, getImgUrl } from "@/utils";
@@ -125,8 +124,7 @@ const formatNumber = (num: any) => {
@apply hover:scale-110 transition-all duration-300 ease-in-out;
}
&-img {
width: 200px;
height: 200px;
@apply h-full w-full rounded-xl overflow-hidden;
}
.top {
@apply absolute w-full h-full top-0 left-0 flex justify-center items-center transition-all duration-300 ease-in-out cursor-pointer;
+1 -2
View File
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import { getQrKey, createQr, checkQr, getLoginStatus } from '@/api/login'
import { onMounted } from '@vue/runtime-core';
import { ref } from 'vue';
import { getUserDetail, loginByCellphone } from '@/api/login';
import { useStore } from 'vuex';
import { useMessage } from 'naive-ui'
@@ -105,7 +104,7 @@ const loginPhone = async () => {
<style lang="scss" scoped>
.login-page {
@apply p-4 flex flex-col items-center justify-center p-20;
@apply flex flex-col items-center justify-center p-20;
}
.login-title {
+1 -1
View File
@@ -115,7 +115,7 @@ const store = useStore()
const handlePlay = (item: any) => {
const tracks = searchDetail.value?.result.songs || []
const musicIndex = (tracks.findIndex((music: any) => music.id == item.id) || 0)
store.commit('setPlayList', tracks.slice(musicIndex))
store.commit('setPlayList', tracks)
}
</script>
+1 -1
View File
@@ -64,7 +64,7 @@ const formatDetail = computed(() => (detail: any) => {
const handlePlay = (item: any) => {
const tracks = recordList.value || []
const musicIndex = (tracks.findIndex((music: any) => music.id == item.id) || 0)
store.commit('setPlayList', tracks.slice(musicIndex))
store.commit('setPlayList', tracks)
}
</script>