ChargerState.vue 816 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view>
  3. <image :src="getchargeState"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: ["chargerState"],
  9. data() {
  10. return {
  11. }
  12. },
  13. computed: {
  14. getchargeState() {
  15. switch (this.chargerState) {
  16. case 0:
  17. return '/static/index/charge-has.png'
  18. case 1:
  19. return '/static/index/charge-doing.png'
  20. case 2:
  21. return '/static/index/charge-doing.png'
  22. case 3:
  23. return '/static/index/charge-has.png'
  24. case 4:
  25. return '/static/index/charge-warn.png'
  26. case 6:
  27. return '/static/index/charge-warn.png'
  28. default:
  29. return '/static/index/charge-null.png'
  30. }
  31. }
  32. },
  33. methods: {
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. image {
  39. width: 70px;
  40. height: 70px;
  41. }
  42. </style>