screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js atob() Method </h2> <p>Decode a Base64 to original string in Vue.js</p> <button @click="myFunction">Click me</button> <p>Encoded String: {{encodedStr}}</p> <p>{{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ encodedStr:'Zm9udGF3ZXNvbWVpY29ucy5jb20=', result:'', } }, methods:{ myFunction(){ this.result = 'Decoded string: ' + atob(this.encodedStr) } } }).mount('#app') </script> </body> </head> </html>