power.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div class="powerContainer" v-if="parseInt(curPower) > 0">
  3. <img src="../static/img/power/power_full.svg" alt="" v-if="parseInt(curPower) >= 81">
  4. <img src="../static/img/power/power_half.svg" alt="" v-if="parseInt(curPower) >= 41 && parseInt(curPower) < 81">
  5. <img src="../static/img/power/power_low.svg" alt="" v-if="parseInt(curPower) >= 21 && parseInt(curPower) < 40">
  6. <img src="../static/img/power/power_none.svg" alt="" v-if="parseInt(curPower) <= 20">
  7. <!--<span>{{curPower}}-->
  8. <!--<em>%</em>-->
  9. </span>
  10. </div>
  11. </template>
  12. <script>
  13. import '../libs/rem';
  14. export default {
  15. props: ['curPower'],
  16. }
  17. </script>
  18. <style scoped>
  19. .powerContainer {
  20. float: right!important;
  21. color: #fff;
  22. font-size: 0.23rem;
  23. width: 0.55rem!important;
  24. overflow: hidden;
  25. }
  26. .powerContainer img {
  27. width: 0.33rem;
  28. line-height: 0.3rem;
  29. }
  30. .powerContainer span {
  31. display: inline-block;
  32. line-height: 0.2rem;
  33. }
  34. .powerContainer em {
  35. font-size: 0.15rem;
  36. }
  37. </style>