pilotLamp.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="pilotLamp">
  3. <view class="item" v-for="item in list" :key="item.name">
  4. <view class="image">
  5. <image style="height: 100%;" src="/static/img/pilot-lamp.png" mode="heightFix" />
  6. <view v-if="item.value" class="bg" />
  7. </view>
  8. <view class="name">
  9. {{ item.name }}
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'pilotLamp',
  17. data() {
  18. return {
  19. list: []
  20. }
  21. },
  22. }
  23. </script>
  24. <style lang="scss" scoped>
  25. .pilotLamp {
  26. display: flex;
  27. flex-wrap: wrap;
  28. .item {
  29. display: flex;
  30. flex-direction: column;
  31. align-items: center;
  32. width: 20%;
  33. .image {
  34. position: relative;
  35. height: 20px;
  36. .bg {
  37. width: 14px;
  38. height: 14px;
  39. border-radius: 50%;
  40. background: #cccccc;
  41. position: absolute;
  42. top: 3px;
  43. left: 3px;
  44. z-index: 9;
  45. animation: lampBackground .5s infinite alternate ease-in-out;
  46. }
  47. @keyframes lampBackground {
  48. from {
  49. background-color: #FF8F4A;
  50. }
  51. to {
  52. background-color: red;
  53. }
  54. }
  55. }
  56. .name {
  57. font-size: 12px;
  58. color: #fff;
  59. margin-top: 6px;
  60. }
  61. }
  62. .item:nth-of-type(n+6) {
  63. margin-top: 10px;
  64. }
  65. }
  66. </style>