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 shift() Method</h2> <p v-for="list in device">{{list}}</p> <button @click="myFunction">Store first element</button> <p>Return First Element: {{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ device:['Desktop','Laptop','Tablet','Mobile'], results:'' } }, methods:{ myFunction(){ this.results = this.device.shift(); }, } }).mount('#app') </script> </body> </head> </html>