JHeap.vue 822 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div>
  3. <h3>堆区</h3>
  4. <div>
  5. <template v-if="objects !== null">
  6. <v-btn v-for="item of objects" :key="item.id" block text :color="item.fresh ? 'red' : 'black'"
  7. @click="handleClickDetail(item)">
  8. <div class="button-text">{{item.id}}</div>
  9. <v-icon v-if="displayNow && item === displayNow" color="red" right>mdi-check</v-icon>
  10. </v-btn>
  11. </template>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'JHeap',
  18. props: {
  19. objects: {
  20. default: () => [],
  21. type: Array
  22. },
  23. displayNow: {
  24. type: Object,
  25. default: () => ({})
  26. }
  27. },
  28. methods: {
  29. handleClickDetail (detail) {
  30. this.$emit('click-detail', detail)
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. @import "common.scss";
  37. </style>