Vue Js Get Current path and filename of Url
Vue Js Get Url's Current Path and Filename: In Vue.js, the current path and filename of a URL can be obtained by using the `window.location.pathname` property, which returns a string containing the path of the currently active route. Here in this tutorial, we will learn how to get the current path and filename by using native Javascript and Vue.js.
written
reviewed
updated
Thanks for your feedback!
Your contributions will help us to improve service.
Vue.js get Current path and filename Syntax
Copied to Clipboard
How to Get path and filename of the current page in Vue.js?
In order to get the path and filename of the current page in Vue.js, you can use the window.location.pathname object property, which contains information about the current URL
Output of above example
Ad