vue2.0开发实践总结之入门篇(2)

const routes = [ { path: 'https://www.jb51.net/', component: App, children: [ {path: '/index/:type', name: 'index', component: Index}, {path: '/home', name: 'home', component: Home}, {path: '/HomeUserInfo/:uid', name: 'homeUserInfo', component: HomeUserInfo}, {path: '/article/:id', name: 'article', component: Article}, {path: '/addmsg', name: 'addMsg', component: AddMsg}, {path: '/search/:types', name: 'searchresult', component: SearchResult}, {path: '/login', name: 'login', component: Login}, {path: '/register', name: 'register', component: Register}, {path: '/modif', name: 'Modifi', component: Modifi}, {path: '/admin', name: 'Admin', component: Admin} ] } ] const router = new VueRouter({ routes: routes, // short for routes: routes linkActiveClass: 'active', // router-link的选中状态的class,也有一个默认的值 history: true })

vue2.0开发实践总结之入门篇


后续更新 项目中遇到的难点,以及vuex使用~ 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwfpfw.html