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 Array Reverse string</h2> <p>Reverse feature in Vue JS,An array is placed in reverse using the reverse() method. The first array element changes into the last one, and vice versa.</p> <button @click="myFunction">Reverse string</button> <p>{{string}}</p> <p>{{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ string:'FONTAWESOMEICONS', results:'' } }, methods:{ myFunction(){ this.results = this.string.split('').reverse().join(''); }, } }).mount('#app') </script> </body> </head> </html>