1***@qq.com
1***@qq.com
  • 发布:2024-01-20 10:08
  • 更新:2024-01-20 11:53
  • 阅读:61

#插件讨论# 【 数字滚动 - 4***@qq.com 】数字是从接口获取赋值的在手机微信小程序上就不管用了

分类:uni-app
关联插件: 数字滚动
2024-01-20 10:08 负责人:无 分享
已邀请:
喜欢技术的前端

喜欢技术的前端 - QQ---445849201

我设置定时器,修改this.num 是正常的,可以检查你的代码

<template>  
    <view class="page">  
        <count-up :num="num" color="#ff9e50" width='13' height='23' fontSize='23'></count-up>  
        <button @tap="add">Add</button>  
        <button @tap="reduce">Reduce</button>  
    </view>  
</template>  

<script>  
    import countUp from '@/components/p-countUp/countUp.vue'  
    export default {  
        components: {  
            countUp  
        },  
        data() {  
            return {  
                num: 123.453  
            };  
        },  
        onLoad() {  
            setTimeout(()=>{  
                this.set()  
            },3000)  
        },  
        methods: {  
            set(){  
                this.num = 111.11  
            },  
            add() {  
                this.num = ++this.num;  
            },  
            reduce() {  
                this.num = --this.num;  
            }  
        }  
    }  
</script>  

<style >  

</style>

要回复问题请先登录注册