-2

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
  • 15
  • 3

2 Answers2

2

have you tried:

var url = window.location.pathname;
str
  • 42,689
  • 17
  • 109
  • 127
-2

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

Anant Vikram Singh
  • 538
  • 1
  • 4
  • 14