Foreword
vue routing mode (mode) is divided into two: url mode
- history: When placed into the production environment, the need for additional redirection configured on the server.
- It can be accessed from the url you can look out
- In addition, when you create a project is not a problem to ask you not to use this mode of history
- Gives you the feeling is a separate address
- history to be included in the probability is much larger than the hash
- the hash : no additional on-line configuration.
Compare
history:
- When placed in the production environment, the need for additional redirection configured on the server.
- Entering the corresponding page, directly behind the display / xxx
hash:
- No additional on-line configuration.
- When entering the corresponding page, after more than a history mode #
Where modification?
In index.js folder inside your router inside
The biggest difference:
hash
When we enter the back of Baidu # a = 1 Enter
We can see that the page has not changed
history
When we entered / one behind Baidu
He will give you generate a new address
In the above people will default server to access your address has changed