Vue.js decode URL
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.js"></script> </head> <body> <div id="app"> <p>Result 1 = {{result}}</p> <button @click="myFunction()">Click Me</button> </div> <script> new Vue({ el: '#app', data: { result:'', myUrl: 'http%3A%2F%2Fwww.example.com%2Findex.html%3Fparam%3D1%26param%3D2' }, methods:{ myFunction: function () { this.result = decodeURIComponent(this.myUrl); } } }); </script> </body> </html>
<!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.js"></script> </head> <body> <div id="app"> <p>Result 1 = {{result}}</p> <button @click="myFunction()">Click Me</button> </div> <script> new Vue({ el: '#app', data: { result:'', myUrl: 'http%3A%2F%2Fwww.example.com%2Findex.html%3Fparam%3D1%26param%3D2' }, methods:{ myFunction: function () { this.result = decodeURIComponent(this.myUrl); } } }); </script> </body> </html>
Copyrights@tutorialsplane.com