latest-transaction.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <table class="w-max">
  3. <thead>
  4. <tr class="fn-sm">
  5. <th class="p-l-md p-y-xs fn-left">{{$t('exchange.d4')}}</th>
  6. <th class="fn-left">{{$t('exchange.d5')}}</th>
  7. <th class="fn-right">{{$t('exchange.d2')}}</th>
  8. <th class="p-r-md p-y-xs fn-right">{{$t('exchange.c5')}}</th>
  9. </tr>
  10. </thead>
  11. <tbody class="color-light">
  12. <tr v-for="(item,idx) in tradeList" :key="idx">
  13. <td class="p-l-md p-y-xs">{{parseTime(item.ts,false,'{h}:{i}:{s}')}}</td>
  14. <td :class="`color-${item.direction}`">
  15. <template v-if="item.direction=='buy'">
  16. {{$t('exchange.b5')}}
  17. </template>
  18. <template v-else-if="'sell'">
  19. {{$t('exchange.b6')}}
  20. </template>
  21. </td>
  22. <td class="fn-right">{{item.price}}</td>
  23. <td class="p-r-md p-y-xs fn-right">{{omitTo(item.amount,8)*1}}</td>
  24. </tr>
  25. </tbody>
  26. </table>
  27. </template>
  28. <script>
  29. import math from "@/utils/class/math";
  30. import date from "@/utils/class/date";
  31. export default {
  32. props: {
  33. tradeList: {
  34. default() {
  35. return [];
  36. },
  37. type: Array,
  38. required: false,
  39. },
  40. },
  41. methods:{
  42. parseTime:date.parseTime,
  43. omitTo:math.omitTo,
  44. }
  45. };
  46. </script>