vue3: 非同期コンポーネント読み込みの移行 (#6580)
* migrate async components * routerとwidgetsも
This commit is contained in:
parent
f9e350b041
commit
0bf4c5cb29
13 changed files with 48 additions and 50 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue