Table vuejs tables and select all checkbox Apr 02, 2018 1 min read tables and select checkbox a vuejs tables and select all checkbox example. View demo html <div id="app"> <div class="text-uppercase text-bold">id selected: {{selected}}</div> <table class="table table-striped table-hover"> <thead> <tr> <th> <label class="form-checkbox"> <input type="checkbox" v-model="selectAll" @click="select"> <i class="form-icon"></i> </label> </th> <th>id</th> <th>name</th> <th>email</th> </tr> </thead> <tbody> <tr v-for="i in items"> <td> <label class="form-checkbox"> <input type="checkbox" :value="i.id" v-model="selected"> <i class="form-icon"></i> </label> </td> <td>{{i.id}}</td> <td>{{i.name}}</td> <td>{{i.email}}</td> </tr> </tbody> </table> </div> HTML Css body{ padding: 50px } CSS JavaScript new Vue({ el: "#app", data: () => ({ items: [ { id: "id1", name: "John Doe", email: "email@example.com" }, { id: "id2", name: "Jone Doe", email: "email2@example.com" } ], selected: [], selectAll: false }), methods: { select() { this.selected = []; if (!this.selectAll) { for (let i in this.items) { this.selected.push(this.items[i].id); } } } } }); JavaScript Demo source: https://codetea.com/ TableCheckboxes
Laravel A Laravel Nova tool for creating responsive tables A Laravel Nova tool for creating responsive tables 28 October 2023
Table An easy way to append extra data to each row of your resource tables An easy way to append extra data to each row of your resource tables 23 October 2023