异步组件 优化首屏加载速度

This commit is contained in:
alger
2021-10-25 11:16:41 +08:00
parent e97f71dce4
commit 6771e44d76
3 changed files with 16 additions and 6 deletions
+7 -1
View File
@@ -30,7 +30,13 @@
import type { SongResult } from '@/type/music';
import { computed } from 'vue';
import { useStore } from 'vuex';
import { AppMenu, PlayBar, SearchBar } from './components';
// import { AppMenu, PlayBar, SearchBar } from './components';
import {defineAsyncComponent} from 'vue';
const AppMenu = defineAsyncComponent(() => import('./components/AppMenu.vue'));
const PlayBar = defineAsyncComponent(() => import('./components/PlayBar.vue'));
const SearchBar = defineAsyncComponent(() => import('./components/SearchBar.vue'));
const store = useStore();