vue3: 非同期コンポーネント読み込みの移行 (#6580)

* migrate async components

* routerとwidgetsも
This commit is contained in:
Xeltica
2020-07-24 18:24:41 +09:00
committed by GitHub
parent f9e350b041
commit 0bf4c5cb29
13 changed files with 48 additions and 50 deletions

View File

@@ -1,11 +1,12 @@
import { createRouter, createWebHistory } from 'vue-router';
import MkIndex from './pages/index.vue';
import { defineAsyncComponent } from 'vue';
const page = (path: string) => () => import(`./pages/${path}.vue`).then(m => m.default);
const page = (path: string) => defineAsyncComponent(() => import(`./pages/${path}.vue`).then(m => m.default));
let indexScrollPos = 0;
export const router = new createRouter({
export const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', name: 'index', component: MkIndex },