Tutorialsplane

Vue.js encode URL


We can use JavaScript Native JavaScript in-built function encodeURIComponent to encode url in vuejs. Here in this tutorial, we are going to explain how you can use this method to encode url. You can also use our online editor to edit and run the code online.


Vue.js encode URL JavaScript Example

You can use encodeURIComponent function in vue.js simply as below –

Example:

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

Try it »

Output of above example-