History usage of vue. router

Source: Internet
Author: User
LetrouternewVueRouter ({hashbang: true, history: true, saveScrollPosition: true, transitionOnLoad: true}) enables the vue-router's history function, which I think is convenient to use, the list page is returned from the details page... let router = new VueRouter ({
Hashbang: true,
History: true,
SaveScrollPosition: true,
TransitionOnLoad: true
})
To enable the history function of vue-router, I think it is convenient to use its location function, that is, it can be automatically located on the return list page of the detailed page.
However, there is a refresh problem.
Do not use history, url format is http://xxx.xxx.xxx/index! Goodslist
After history is used, the url format is http://xxx.xxx.xxx/goodslist.
Excuse me, how can I use history to automatically add/index # To each url address #! .

Reply content:

Let router = new VueRouter ({
Hashbang: true,
History: true,
SaveScrollPosition: true,
TransitionOnLoad: true
})
To enable the history function of vue-router, I think it is convenient to use its location function, that is, it can be automatically located on the return list page of the detailed page.
However, there is a refresh problem.
Do not use history, url format is http://xxx.xxx.xxx/index! Goodslist
After history is used, the url format is http://xxx.xxx.xxx/goodslist.
Excuse me, how can I use history to automatically add/index # To each url address #! .

There are two frontend routing modes: hash mode and # navigation. The other is the Html5HistoryAPI mode, where # is not used #.
When you enable history, you use the Html5HistoryAPI mode. This mode is not used #

History. pushstate write it in?

Why do I need this when the history mode is enabled #! What about it?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.