-3

How can I get current URL like this.

For example, if the url is:

http://www.test.com/app/one.bc

I want to get the path without the address the main page so like:

/app/one.bc

Raha
  • 5
  • 3

2 Answers2

2

have you tried:

var url = window.location.pathname;
str
  • 38,402
  • 15
  • 99
  • 123
-2

try using console.log(this.$route);