- 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.
推薦閱讀
- 前端跨界開發指南:JavaScript工具庫原理解析與實戰
- Apache Spark 2.x Machine Learning Cookbook
- Java應用開發與實踐
- JavaScript+Vue+React全程實例
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發 (未來書庫)
- JavaScript入門經典
- Python機器學習基礎教程
- Unity 5 for Android Essentials
- Shopify Application Development
- Learning Apache Thrift
- Python程序設計:基礎與實踐
- Serverless從入門到進階:架構、原理與實踐
- AngularJS by Example
- 深度剖析ApacheDubbo核心技術內幕
- Performance Testing with JMeter 3(Third Edition)