power.vue 1018 B

1234567891011121314151617181920212223242526272829303132333435
  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. </div>
  8. </template>
  9. <script>
  10. export default {
  11. props: ['curPower'],
  12. }
  13. </script>
  14. <style scoped>
  15. .powerContainer {
  16. float: right!important;
  17. color: #fff;
  18. font-size:1rem;
  19. width: 3rem!important;
  20. overflow: hidden;
  21. }
  22. .powerContainer img {
  23. width:2rem;
  24. line-height: 0.3rem;
  25. }
  26. .powerContainer span {
  27. display: inline-block;
  28. line-height: 1rem;
  29. }
  30. .powerContainer em {
  31. font-size: 1rem;
  32. }
  33. </style>