K
K
Ksey1232019-12-18 13:24:04
Vue.js
Ksey123, 2019-12-18 13:24:04

How to hide path in url with vue-router?

Good time!
The question is:
How and with what can I hide the path to the page leaving only http://site.com, not site.com/somepage
I use vue-router, as I understand it, for everyone, conditionally 10 pages - you can’t write path: ' /'.
Tell me how to be. Maybe in general everything is simple and you don’t need to pick vue-router, but it’s enough to configure .htaccess for example. Well, when the page was reloaded, it gave out http://site.com, no matter where you were on the site.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-12-18
@Ksey123

https://habr.com/ru/post/350750/
+
https://ru.vuejs.org/v2/guide/components-dynamic-a...
The link does not take you to another page, but loads another component on page and you will always have site.com

O
Oleg Koltunov, 2019-12-18
@i_olega

{
  path: '*', redirect: '/'
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question