路由: vue-router

// vue-router 說明
// 1.添加新路由 {name:'',path:'',component:Hello }
// 2.配置子路由 { children: [{path: '', component: Hello }] }
// 3.路由傳遞參數
// (1:) name => $route.name
// (2:) :to="{name: 'shouye', params: {key,value}}  => 頁面中使用: $route.params.key"
// 4.單頁面多路由 { components: { default: Hello, left: Hi1, right: hi2 } }
// 5.url傳遞參數(:key(正則表達式)) { path: '/params/:newId(\\d+)' } => 頁面中使用: $route.params.newsId
// 6.重定向 { redirect : '' }
// 7.路由別名 {alias: '/abc'}
// 8.路由過渡動畫 transition標籤 name屬性爲css動畫效果, mode屬性 out-in
// 9.mode : histroy/ hash (路由後面 # ); 404: { path: '*', component: Error }
// 10.路由鉤子 (模板中: beforeRouteEnter, beforeRouteLeave )
// 11.編程式導航 ( 前進後退 : this.$route.go(1/-1) , 跳轉: this.$route.push('/') )css

相關文章
相關標籤/搜索