Tutorialsplane

Vue.js get hash from URL


We can use location hash property to get the hash(#) part from url. Here in this tutorial, we are going to explain how you can get the hash(#) from url in Vue.js. You can also use our online editor to edit and run the code online.


Vue.js get hash from URL JavaScript Example

If you want to get the hash from url, you can use the below syntax-

Example:

<div id="app">
	<p>{{result}}</p>
	<button>Click Me</button>
</div>
  

Output of above example-