You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Home.vue 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <v-container>
  3. <v-row dense>
  4. <v-col v-for="(item, i) in items" :key="i" cols="12">
  5. <v-card class="mx-auto my-12" max-width="500">
  6. <div class="d-flex flex-no-wrap justify-space-between">
  7. <div>
  8. <v-card-title class="headline" v-text="item.title"></v-card-title>
  9. <v-card-subtitle v-text="item.amount"></v-card-subtitle>
  10. <v-btn class="mx-2" fab dark small color="pink" @click="increment">
  11. <v-icon>mdi-plus</v-icon>
  12. </v-btn>
  13. <v-btn class="mx-2" fab dark small color="pink" @click="decreament">
  14. <v-icon>mdi-minus</v-icon>
  15. </v-btn>
  16. </div>
  17. <v-avatar class="ma-3" size="125" tile>
  18. <v-img :src="item.src"></v-img>
  19. </v-avatar>
  20. </div>
  21. <!-- Nutrion Distribution
  22. <v-sparkline
  23. :labels="labels"
  24. :fill="fill"
  25. :gradient="gradient"
  26. :line-width="width"
  27. :padding="padding"
  28. :smooth="radius || false"
  29. :value="value"
  30. auto-draw
  31. style="top: -10px; position:relative"
  32. ></v-sparkline>-->
  33. <v-divider class="mx-4"></v-divider>
  34. <v-card-actions>
  35. <v-btn color="deep-purple lighten-2" text @click="reserve">Edit</v-btn>
  36. <v-btn color="deep-purple lighten-2" text @click="reserve">Remove</v-btn>
  37. </v-card-actions>
  38. </v-card>
  39. </v-col>
  40. </v-row>
  41. <!-- //###################################################################################################### -->
  42. </v-container>
  43. </template>
  44. <script>
  45. export default {
  46. name: "Home",
  47. computed: {
  48. items() {
  49. return this.$store.state.items;
  50. }
  51. },
  52. data: () => ({
  53. gradients: [
  54. ["#222"],
  55. ["#42b3f4"],
  56. ["red", "orange", "yellow"],
  57. ["purple", "violet"],
  58. ["#00c6ff", "#F0F", "#FF0"],
  59. ["#f72047", "#ffd200", "#1feaea"]
  60. ],
  61. fill: false,
  62. gradient: ["#00c6ff", "#F0F", "#FF0"],
  63. radius: 5,
  64. labels: [" ", "Protein", "Fat", "Carbohydrate", "Water", "Vitamins"],
  65. value: [200, 675, 410, 390, 310, 460]
  66. // count: this.$store.state.count,
  67. // items: store.state.items,
  68. // items: [
  69. // {
  70. // color: '#1F7087',
  71. // src: 'https://cdn.vuetifyjs.com/images/cards/foster.jpg',
  72. // title: 'Supermodel',
  73. // artist: 'Foster the People',
  74. // },
  75. // {
  76. // color: '#952175',
  77. // src: 'https://cdn.vuetifyjs.com/images/cards/halcyon.png',
  78. // title: 'Halcyon Days',
  79. // artist: 'Ellie Goulding',
  80. // },
  81. // ],
  82. }),
  83. methods: {
  84. increament() {
  85. this.$store.commit('increament')
  86. },
  87. decreament() {
  88. this.$store.commit('decreament')
  89. }
  90. }
  91. };
  92. </script>