screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <h3>Vue Js Get First Element of Array using Array Shift() Method</h3> <div id="app"> <p>{{arr}}</p> <p v-if="firstElement">First Element: {{firstElement}}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { arr: ['Vue js', 'React Js', 'Angular Js', 'Express Js', 'Node Js'], firstElement: '' }; }, mounted() { this.firstElement = this.arr.shift() } }) </script> </body> </html>