JThread.vue 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div>
  3. <h3>线程栈</h3>
  4. <div class="j-container">
  5. <template v-if="threadStack !== null">
  6. <v-btn v-for="item of threadStack" :key="item.methodName" block text :color="item.fresh ? 'red' : 'black'"
  7. @click="handleClickDetail(item)">
  8. <div class="button-text">{{item.methodName}}</div>
  9. <v-icon v-if="item.methodName === itemNowId" color="blue" right>mdi-check</v-icon>
  10. </v-btn>
  11. </template>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'JThread',
  18. props: {
  19. threadStack: {
  20. type: Array,
  21. default: () => []
  22. }
  23. },
  24. data () {
  25. return {
  26. itemNowId: null
  27. }
  28. },
  29. methods: {
  30. handleClickDetail (detail) {
  31. this.itemNowId = detail.methodName
  32. this.$emit('click-detail', {
  33. detail,
  34. component: 'j-thread-detail'
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. @import "common.scss";
  42. </style>