screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <h4>Vue js Break an array list into two arrays (lists)</h4> <div id="app"> <div>Full Array: {{array}}</div><br> <div>Array 1: {{ arr1 }}</div><br> <div>Array 2: {{ arr2 }}</div><br> </div> <script type="module"> const app = Vue.createApp({ data() { return { array: ['Vue', 'React', 'Angular', 'Javascript', 'Node', 'Express', 'CSS'], }; }, computed: { arr1() { return this.array.splice(0, 2); }, arr2() { return this.array }, }, }); app.mount('#app'); </script> </body> </html>