Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用vue在安卓上面定时器有问题 #7566

Closed
ynqq opened this issue Sep 9, 2020 · 4 comments
Closed

使用vue在安卓上面定时器有问题 #7566

ynqq opened this issue Sep 9, 2020 · 4 comments
Labels
F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@ynqq
Copy link

ynqq commented Sep 9, 2020

相关平台

微信小程序

小程序基础库: 2.12.2
使用框架: Vue 2

复现步骤

setInterval(() => {
this.num ;
}, 2000);

期望结果

准时执行

实际结果

忽快忽慢

环境信息

 Taro CLI 3.0.2 environment info:
    System:
      OS: macOS 10.14.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.0.2 => 3.0.2 
      @tarojs/mini-runner: 3.0.2 => 3.0.2 
      @tarojs/runtime: 3.0.2 => 3.0.2 
      @tarojs/taro: 3.0.2 => 3.0.2 
      @tarojs/webpack-runner: 3.0.2 => 3.0.2 
      babel-preset-taro: 3.0.2 => 3.0.2 
      eslint-config-taro: 3.0.2 => 3.0.2 
    npmGlobalPackages:
      typescript: 3.5.3

补充信息

就是一个2s加一的定时器,在开发者工具和ios没问题,安卓上面忽快忽慢 但是用react就没问题

@taro-bot2 taro-bot2 bot added F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 9, 2020
@ynqq
Copy link
Author

ynqq commented Sep 9, 2020

this.num ++
这个提交的时候咋没了

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 10, 2020

感觉不是 Taro 的问题,试试 H5

@xiaoyao96
Copy link
Contributor

this.num ++,源码应该是触发了setData。可能是setData数据量过大,或者过于频繁,导致的渲染卡顿。建议写个精简的demo再试试。

@ynqq
Copy link
Author

ynqq commented Sep 11, 2020

this.num ++,源码应该是触发了setData。可能是setData数据量过大,或者过于频繁,导致的渲染卡顿。建议写个精简的demo再试试。

界面上面没啥 就一个数字和 vant的手风琴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

3 participants