mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-04 03:11:40 +00:00
Added routing and templates folder
This commit is contained in:
@@ -14,14 +14,4 @@
|
||||
// }
|
||||
|
||||
// document.getElementById(index).style.display = "block";
|
||||
// }
|
||||
|
||||
let inputTab = new Vue({
|
||||
el: "#input-tab",
|
||||
data: {
|
||||
sliders: [
|
||||
{ value: 25 },
|
||||
{ value: 30 }
|
||||
]
|
||||
}
|
||||
})
|
||||
// }
|
||||
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')
|
||||
2626
Site/JS/vue-router.js
Normal file
2626
Site/JS/vue-router.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user