Understanding of routing

Simply put, the route is to show different content depending on the page or url address.
Speaking of the route, the first thought should be the router, the router works what is it?
Router function is a transfer station, the network is the object of a packet by a router to forward. How the router forwards packets to achieve it?
The principle:
as a person, be sure to have a map in his mind to go in somewhere, but also a map inside each router, this map is the routing table.
Included in this routing table has all the destination address of the router to the network master, and by this network router to the best path, the best path refers to a specific address of the next router interface or router.
So, JavaScript routing should also have the same principles. It is to use code to write something with routing capability, with some JS code to achieve the function of the router.

Understand is this: that you want to go, then go the route (this route need to create, it is to create router instance) find on the map, on the map by a corresponding address, then directs you where to go. Then match the corresponding page to match the path passing through. Because the route is to match different pages depending on the url. Matched to the page will appear on the inside, which is the export route, that is, you find the map to find a place.
That is the route by himself created, reaching a purpose different paths of different pages.
---------------------
Author: yufanhui
Source: CSDN
Original: https: //blog.csdn.net/yufanhui/article/details/81951699
Disclaimer: This article as a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/superclound/p/11261466.html