screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> </head> <body> <div id="app"> <v-app> <v-container> <h3>Vuetify Checkbox Select All | Unselect All</h3> <v-row> <v-col class="form-check"> <v-checkbox v-model="checkAll" label="Select all" id="selectAll"></v-checkbox> </v-col> </v-row> <v-row> <v-col v-for="c in country" :key="c.id"> <v-checkbox v-model="checked" :value="c.countryName" :label="c.countryName" :id="c.id"></v-checkbox> </v-col> </v-row> <v-row> <p>Checked Value: {{ checked }}</p> </v-row> </v-container> </v-app> </div> <script> new Vue({ el: '#app', vuetify: new Vuetify(), data() { return { country: [ { id: '5', countryName: 'CANADA' }, { id: '6', countryName: 'GERMANY' }, { id: '7', countryName: 'FRANCE' }, { id: '8', countryName: 'BRAZIL' }, { id: '9', countryName: 'JAPAN' }, { id: '10', countryName: 'CHINA' }, ], checked: [] }; }, computed: { checkAll: { get() { return this.country ? this.checked.length === this.country.length : false; }, set(value) { if (value) { this.checked = this.country.map((c) => c.countryName); } else { this.checked = []; } } } } }) </script> </body> </html>