- 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.
推薦閱讀
- Mastering Visual Studio 2017
- Git Version Control Cookbook
- Blockly創意趣味編程
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐
- Python Data Science Cookbook
- 響應式Web設計:HTML5和CSS3實戰(第2版)
- Apache Camel Developer's Cookbook
- Raspberry Pi Robotic Blueprints
- JBoss:Developer's Guide
- FFmpeg開發實戰:從零基礎到短視頻上線
- iOS開發項目化入門教程
- 青少年Python趣味編程
- Microsoft XNA 4.0 Game Development Cookbook
- TensorFlow.NET實戰
- Isomorphic JavaScript Web Development