vue3: 非同期コンポーネント読み込みの移行 (#6580)
* migrate async components * routerとwidgetsも
This commit is contained in:
@@ -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 },
|
||||
|
Reference in New Issue
Block a user