Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <v-btn @click="explodeAll">{{exploded}}</v-btn>
  2.  
  3. <v-data-table
  4. :headers="headers"
  5. :items="items"
  6. item-key="name"
  7. ref="itemsTable"
  8. expand
  9. >
  10. (..)
  11. <template slot="expand" slot-scope="props">
  12. <v-card flat>
  13. <v-card-text>Peek-a-boo!</v-card-text>
  14. </v-card>
  15. </template>
  16. (..)
  17. data () {
  18. return {
  19. exploded: false,
  20. items: [..],
  21. headers: [..],
  22. }
  23. },
  24. methods: {
  25. explodeAll() {
  26. this.exploded = !this.exploded
  27. for (let i = 0; i < this.items.length; i += 1) {
  28. const item = this.items[i];
  29. this.$set(this.$refs.itemsTable.expanded, item.name, this.exploded);
  30. }
  31. }
  32. },
  33. (..)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement