//创建路由对象并配置路由规则
let router = new VueRouter({
routes:[
{path:'/',redirect:{name:"home"}}, // 重定向到主页
{name:'home',path:'/home',component:Home},
{path:'/music',component:Music},
{path:'/movie',component:Movie},
{name:'img',path:'/picture22',component:Picture},
{name:'musicDetail',path:'/musicDetail/:id/:name',component:MusicDetail},
{path:'*',component:NotFound},//全不匹配的情况下,返回404,路由按顺序从上到下,依次匹配。最后一个*能匹配全部,
]
});