vue push router view code example
Example 1: vue router push
this.$router.push("/path");
Example 2: router configuration vue
npm install --save vue-router
Vue.use(VueRouter):
const routes=[
{path: '/home', component: [componentName]},
{path: '/features', component: [componentName2]},
.
.
.
];
const router=new VueRouter({
routes,
mode: 'history'
});
new Vue({
router, <----
.
.
}).$mount('#app')
<template>
<div id="app">
<Navbar></Navbar>
<router-view> </router-view> <----------
<Footer></Footer>
</div>
</template>