From f3619b20e1c5baa342eb7466c67c44d3192bb3eb Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Tue, 13 Apr 2021 00:52:32 -0500 Subject: Initial TypeScript refactoring --- src/router/index.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/router/index.ts (limited to 'src/router/index.ts') diff --git a/src/router/index.ts b/src/router/index.ts new file mode 100644 index 0000000..7a598b3 --- /dev/null +++ b/src/router/index.ts @@ -0,0 +1,27 @@ +import { createRouter, createWebHashHistory } from 'vue-router'; +import Editor from '../views/Editor.vue'; +import About from '../views/About.vue'; + +const routes = [ + { + path: '/', + name: 'About', + component: About, + }, + { + path: '/editor', + name: 'Editor', + // route level code-splitting + // this generates a separate chunk (about.[hash].js) for this route + // which is lazy-loaded when the route is visited. + // component: () => import(/* webpackChunkName: "about" */ '../views/Editor.vue'), + component: Editor, + }, +]; + +const router = createRouter({ + history: createWebHashHistory(), + routes, +}); + +export default router; -- cgit v1.2.3