ChargerState.vue 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="chargeState">
  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. .chargeState{
  39. image {
  40. width: 70px;
  41. height: 70px;
  42. padding-right: 41px;
  43. }
  44. }
  45. .chargeState:last-child{
  46. image{
  47. padding: 0;
  48. }
  49. }
  50. </style>