1 定义路由组件
const routes=[
配置根路由
{
path:'/',
redirect:'/html5'},
{
path:'/html5',component:HTML5
},
{
path:'/java',
component:Java
},
{
path:'/Python',
component:Python
}];
2 创建router实例
const router=new VueRouter({
routes
});
3 将路由挂载到vue中
new Vue({
router
}).$mount('#app');