mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-06 03:31:41 +00:00
Added routing and templates folder
This commit is contained in:
22
Site/JS/routes.js
Normal file
22
Site/JS/routes.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// need to import templates from files
|
||||
const Vision = { template: '<div id="vision"><nav class="nav"><router-link to="/input"><a>Input</a></router-link></nav><router-view></router-view></div>' }
|
||||
const Input = { template: '<p>Input page</p>' }
|
||||
const Setting = { template: '<p>Settings page</p>' }
|
||||
|
||||
const routes = [
|
||||
{ path: '/', component: Vision , children: [
|
||||
{ path: 'input', component: Input }
|
||||
]},
|
||||
{ path: '/vision', component: Vision , children: [
|
||||
{ path: 'input', component: Input }
|
||||
]},
|
||||
{ path: '/settings', component: Setting }
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes
|
||||
})
|
||||
|
||||
const app = new Vue({
|
||||
router
|
||||
}).$mount('#app')
|
||||
Reference in New Issue
Block a user