Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split up router configuration into index.js and routes.js file for ro…
…utes testing
- Loading branch information
Showing
2 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
import Vue from "vue" | ||
import Router from "vue-router" | ||
import Dashboard from "@/views/Dashboard.vue" | ||
import TaskBoard from "@/views/TaskBoard.vue" | ||
import routes from "./routes" | ||
|
||
Vue.use(Router) | ||
|
||
const router = new Router({ | ||
// mode: 'history', | ||
routes: [ | ||
{ | ||
path: "/", | ||
name: "home", | ||
redirect: "/dashboard" | ||
}, | ||
{ | ||
path: "/dashboard", | ||
name: "dashboard", | ||
component: Dashboard | ||
}, | ||
{ | ||
path: "/boards/:id", | ||
name: "task-board", | ||
component: TaskBoard | ||
} | ||
] | ||
}) | ||
const router = new Router({ routes }) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Dashboard from "@/views/Dashboard.vue" | ||
import TaskBoard from "@/views/TaskBoard.vue" | ||
|
||
export default [ | ||
{ | ||
path: "/", | ||
name: "home", | ||
redirect: "/dashboard" | ||
}, | ||
{ | ||
path: "/dashboard", | ||
name: "dashboard", | ||
component: Dashboard | ||
}, | ||
{ | ||
path: "/boards/:id", | ||
name: "task-board", | ||
component: TaskBoard | ||
} | ||
] |