Search
 
SCRIPT & CODE EXAMPLE
 

HTML

vuetify datatable header checkbox select all

<!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@3.x/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
  <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-content>
        <v-container>
          <h2>Data Table</h2>

          <v-data-table v-model="selectedTasks" :headers="headers" :items="tasks" item-key="id" show-select>

            <template v-slot:body="{ items }">
            <tbody>
                <tr v-for="item in items" :key="item.id">
                    <td>
                        <v-checkbox v-model="selectedTasks" :value="item" style="margin:0px;padding:0px"
                            hide-details />
                    </td>
                    <td>{{ item.text }}</td>
                    <td>
                        <v-btn text icon x-small>
                            Edit
                        </v-btn>
                    </td>
                </tr>
            </tbody>
            </template>
          </v-data-table>
        </v-container>
      </v-content>
    </v-app>
  </div>

  <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>
  <script>
    new Vue({
      el: '#app',
      vuetify: new Vuetify(),

      data() {
        return {
          headers: [{
              text: 'task',
              value: 'text'
            },
            {
              text: 'actions'
            }
          ],
          selectedTasks: []
        }
      },
      computed: {
        tasks() {
          return [{
              id: 1,
              text: 'Collect packets'
            },
            {
              id: 2,
              text: 'Buy bread'
            }
          ]
        }
      }
    })
  </script>
</body>

</html>
Comment

PREVIOUS NEXT
Code Example
Html :: short cut key to write basic html code 
Html :: Heading Tag Checker 
Html :: hover message html 
Html :: bootstrap 5 natification 
Html :: boostrap date input withour day 
Html :: list links in a website python html 
Html :: html entity for asc desc 
Html :: HTML <del 
Html :: markdown open link in new tab 
Html :: Minnimunu in html inputs 
Html :: show html files from firebase android studio 
Html :: developer html template 
Html :: vuejs @change only one time 
Html :: how to get a result in the input form 
Html :: fab view 
Html :: is colby cool 
Html :: read_html pandas skiprows function example 
Html :: how to change html code with aspx.cs 
Html :: command for getting the .odoorc file 
Html :: add link to text using span html 
Html :: 360 degree rotate image website code 
Html :: sum total free html code 
Html :: html5 use of section tag in onepage template 
Html :: error pop writing html 
Html :: how to use div in html 
Html :: change td color html 
Html :: Uncaught ReferenceError: Chartist is not defined 
Css :: css background image fit 
Css :: css first td 
Css :: css hide div on mobile 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =