How does Vue get an absolute address by routing name

for example, the route name is
"test1","test2"
the URL is
domain.com/test1 or domain.com/test2

how to get this full address

in the official document, there is only one $route.path whose address is obtained through the current route

.

but there is no similar method in $router

Mar.03,2021

location.origin


the complete address does not need to be obtained by route, can't the native location.href be obtained?


console.log (location); print location, to see what you want

Menu