npm install router code example
Example 1: installing vue router & implementation
npm install vue-router
import VueRouter from 'vue-router';
Vue.use(VueRouter);
const router = new VueRouter({
routes,
mode: 'history'
});
new Vue({
router,
render: h => h(App)
}).$mount('#app')
import linkName from './components/fileName.vue';
export const routes = [
{
path: '/',
component: linkName
}
]
Example 2: install react router
$ npm install --save react-router
Example 3: npm install router
npm install router