Routing is essentially the way you navigate through a website or web-application.
Slide 5
Client Side Routing
Slide 6
Client Side Routing
vs
Server Side Routing
Slide 7
Server Side Routing
Client Side Routing
! !
!
Fast time to first paint
Fast Routing
Optimized for SEO
Smooth Transitions
"
Full page refresh
"
Slower routing
"
!
longer time to first paint
"
Not SEO friendly
import Vue from "vue"; import Router from "vue-router"; import routes from "./routes"; Vue.use(Router); const router = new Router({ routes, mode: "history" }); export default router; src/router/index.js
Slide 16
import Vue from "vue"; import App from "./App.vue"; import router from "./router"; new Vue({ router, render: h %=> h(App) }).$mount("#app");
src/main.js
Slide 17
When
Slide 18
β’ Nested route/view mapping β’ Modular, component-based router configuration β’ Route params, query, wildcards β’ View transition effects powered by Vue.js' transition system β’ Fine-grained navigation control β’ Links with automatic active CSS classes β’ HTML5 history mode or hash mode, with auto-fallback in IE9 β’ Customizable Scroll Behavior
Slide 19
β’ Nested route/view mapping β’ Modular, component-based router configuration β’ Route params, query, wildcards β’ View transition effects powered by Vue.js' transition system β’ Fine-grained navigation control β’ Links with automatic active CSS classes β’ HTML5 history mode or hash mode, with auto-fallback in IE9 β’ Customizable Scroll Behavior