pilotLamp.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. animation: lampBackground .5s infinite alternate ease-in-out;
  45. }
  46. @keyframes lampBackground {
  47. from {
  48. background-color: #FF8F4A;
  49. }
  50. to {
  51. background-color: red;
  52. }
  53. }
  54. }
  55. .name {
  56. font-size: 12px;
  57. color: #fff;
  58. margin-top: 6px;
  59. }
  60. }
  61. .item:nth-of-type(n+6) {
  62. margin-top: 10px;
  63. }
  64. }
  65. </style>