1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <view>
- <view class="uni__number" :style="{ color: color, 'font-size': size+'px' }"> {{currentValue}}</view>
- </view>
- </template>
- <script>
- export default {
- name: "LEDFont",
- props: {
- size: {
- type: Number,
- value: '24'
- },
- color: {
- type: String,
- default: '#000000'
- },
- showValue: {
- type: Number,
- default: 0
- }
- },
- watch: {
- showValue(val) {
- // console.log('showValue:',val);
- this.currentValue = val;
- this.$forceUpdate()
- },
- },
- created: function(e) {
- this.currentValue = this.showValue;
- },
- data() {
- return {
- currentValut:0
- };
- }
- }
- </script>
- <style scoped>
- @font-face {
- font-family: 'UnidreamLED';
- src: url('~@/static/font/UnidreamLED.ttf');
- }
- .uni__number {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- justify-content: center;
- align-items: center;
- height: 56rpx;
- line-height: 56rpx;
- margin: 5rpx;
- text-align: center;
- font-size: 23px;
- font-family: UnidreamLED;
- border-radius: 3px;
- }
- </style>
|