MatrixCard.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="main" v-if="values.length > 0">
  3. <div style="font-size:15px">{{ title }}</div>
  4. <div class="content">
  5. <WindturbineMinCard
  6. v-for="vs in values"
  7. :key="vs"
  8. :status="vs.status"
  9. :power="vs.power"
  10. :windSpeed="vs.windSpeed"
  11. :rollSpeed="vs.rollSpeed"
  12. :windturbineId="vs.windturbineId"
  13. ></WindturbineMinCard>
  14. </div>
  15. <div class="bottom"></div>
  16. </div>
  17. </template>
  18. <script>
  19. import WindturbineMinCard from "./WindturbineMinCard.vue";
  20. export default {
  21. name: "MatrixCard",
  22. props: ["title", "datas"],
  23. data() {
  24. return {
  25. values: [],
  26. };
  27. },
  28. mounted() {
  29. this.values = this.datas.value || [];
  30. },
  31. components: {
  32. WindturbineMinCard,
  33. },
  34. watch: {
  35. datas(val) {
  36. this.values = val.value;
  37. },
  38. },
  39. };
  40. </script>
  41. <style scoped>
  42. .content {
  43. display: grid;
  44. grid-template-columns: repeat(5, 20%);
  45. }
  46. .bottom {
  47. background-color: #292929;
  48. width: 100%;
  49. height: 2px;
  50. margin-top: 5px;
  51. }
  52. .main {
  53. margin-bottom: 15px;
  54. margin-left: 5px;
  55. margin-right: 5px;
  56. }
  57. </style>