How to use Router in Vue to remove the default Anchor Point in url
This article focuses on "how to use Router in Vue to remove the default anchor in url". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to use Router in Vue to remove the default anchor in url"!
Hash mode url
Vue-router default hash mode-uses URL's hash to simulate a full URL, so when the URL changes, the page does not reload.
If you don't want this default hash mode, you can use the routed history mode, which makes full use of history.pushState API to complete the URL jump without reloading the page.
Index.js
Vue.use (Router) export default new Router ({mode: 'history', routes: [{path: "/ xxx", name: "xxx", component: Xxx,}]})
History mode
After modification, url becomes a normal url.
At this point, I believe you have a deeper understanding of "how to use Router in Vue to remove the default anchor in url". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!