Router & Vue

Matt Jhou

Source Code:

https://github.com/ycj1905/udemy-vue-router

https://github.com/ycj1905/vue-meetup-vuex

Router

Why Router ?

Config Router

1. npm install --save vue-router

2. route.js

3 main.js

4 App.Vue

How ?

1. template (View)

2. script (Controler)

Route with Info

1. paramaters

2. query

Nested Router

Name a path !

State Management

1. emit() & props

2. Event Bus

Review:

https://slides.com/mattjhou/vue-component

Vue

Better Way to manage State !

Central State Mangement

Config with Simple State

1. npm install --save vuex

2. store.js

3. main.js

get, set State

Official Documents !

https://vuex.vuejs.org/zh-cn/core-concepts.html

Sharpen  code

...mapState

...mapGetter

...mapMutation

...mapAction

 Modualize !

your management

Namespace Issue ?

WORD CLOUD...

Router & Vuex

By Matt Jhou

Router & Vuex

  • 223