LEDFont.vue 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view>
  3. <view class="uni__number" :style="{ color: color, 'font-size': size+'px' }"> {{currentValue}} </view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: "LEDFont",
  9. props: {
  10. size: {
  11. type: Number,
  12. value: '24'
  13. },
  14. color: {
  15. type: String,
  16. default: '#000000'
  17. },
  18. showValue: {
  19. type: Number,
  20. default: 0
  21. }
  22. },
  23. watch: {
  24. showValue(val) {
  25. this.currentValue = val;
  26. },
  27. },
  28. created: function(e) {
  29. this.currentValue = this.showValue;
  30. },
  31. data() {
  32. return {
  33. currentValut:0
  34. };
  35. }
  36. }
  37. </script>
  38. <style scoped>
  39. @font-face {
  40. font-family: 'UnidreamLED';
  41. src: url('~@/static/font/UnidreamLED.ttf');
  42. }
  43. .uni__number {
  44. /* #ifndef APP-NVUE */
  45. display: flex;
  46. /* #endif */
  47. justify-content: center;
  48. align-items: center;
  49. width: 56rpx;
  50. height: 56rpx;
  51. line-height: 56rpx;
  52. margin: 5rpx;
  53. text-align: center;
  54. font-size: 23px;
  55. font-family: UnidreamLED;
  56. border-radius: 3px;
  57. }
  58. </style>