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 slice() Method</h2> <button @click="myFunction">click me</button> <p>{{array}}</p> <p>New array: {{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ array:['Font Awesome Icons','Sarkari Naukri Exams','Tutorials Plane','School Geeks Technology'], results:'' } }, methods:{ myFunction(){ this.results = this.array.slice(1,3); }, } }).mount('#app') </script> </body> </head> </html>