Added routing and templates folder

This commit is contained in:
Sagi Frimer
2019-03-10 01:12:53 +02:00
parent 4e0dad8955
commit e84c9c5053
10 changed files with 2715 additions and 47 deletions

View File

@@ -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
View 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

File diff suppressed because it is too large Load Diff