screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h1>Vue Js Remove/Delete Array from Array of Arrays</h1> <ul> <li v-for="(item, index) in arrayOfArrays" :key="index"> {{ item }} <button @click="removeArray(index)">Remove Array</button> </li> </ul> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { arrayOfArrays: [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] }; }, methods: { removeArray(index) { this.arrayOfArrays.splice(index, 1); } } }); </script> <style scoped> #app { font-family: Arial, sans-serif; font-size: 16px; color: #333; } h1 { font-size: 24px; font-weight: bold; margin-bottom: 20px; } ul { list-style: none; padding: 0; margin: 0; } li { margin-bottom: 10px; } button { background-color: #007bff; color: #fff; border: none; border-radius: 5px; padding: 8px 12px; cursor: pointer; } button:hover { background-color: #0069d9; } </style> </body> </html>