- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 79字
- 2021-07-02 19:57:15
Vue Router
Vue Router allows you to map different states of your SPA to different URLs, giving you virtual pages. For example,mydomain.com/might be the front page of a blog and have a component hierarchy like this:
<p id="app"> <my-header></my-header> <blog-summaries></blog-summaries> <my-footer></my-footer> </p>
Whereasmydomain.com/post/1might be an inpidual post from the blog and look like this:
<p id="app"> <my-header></my-header> <blog-post post-id="id"> <my-footer></my-footer> </p>
Changing from one page to the other doesn't require areloadof the page, just swapping the middle component to reflect the state of the URL, which is exactly what Vue Router does.
推薦閱讀
- Expert C++
- 程序員面試算法寶典
- INSTANT Sencha Touch
- Cassandra Design Patterns(Second Edition)
- 差分進化算法及其高維多目標優化應用
- 你不知道的JavaScript(中卷)
- C語言實驗指導及習題解析
- SSM輕量級框架應用實戰
- Spring MVC+MyBatis開發從入門到項目實踐(超值版)
- Magento 2 Beginners Guide
- OpenCV 3.0 Computer Vision with Java
- Ionic3與CodePush初探:支持跨平臺與熱更新的App開發技術
- Mastering JavaScript Promises
- Java核心技術速學版(第3版)
- Learning Perforce SCM