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

想问一下在vue2中用axios请求成功后在success函数里面调用停止函数,动画会立即停止,而且指针位置也不对,不放在请求里面就没事 #314

Closed
D-xhao opened this issue Aug 18, 2022 · 3 comments

Comments

@D-xhao
Copy link

D-xhao commented Aug 18, 2022

  • 你当前是什么框架(必填):vue2
  • 你使用的是哪个包(必填):@lucky-canvas/vue
  • 你当前插件的版本(必填):"@lucky-canvas/vue": "^0.1.11",
  • 当前环境是小程序还是浏览器(选填):
  • 详细描述你的bug:在vue2中用axios请求成功后在success函数里面调用停止函数会立即停止,而且指针位置也不对,不放在请求里面就没事
  • 问题代码(重要):
// 代码开始, 别再放歪了行吗
 // 点击抽奖按钮会触发star回调
//html
  <LuckyWheel
    ref="myLucky"
    width="90vw"
    height="90vw"
    :prizes="prizes"
    :blocks="blocks"
    :buttons="buttons"
    @start="startCallback"
    @end="endCallback"
  />

//js
//引入方式
import {LuckyWheel} from '@lucky-canvas/vue'
//组件使用
  components:{
    [LuckyWheel.name]:LuckyWheel
  },
//开始按钮
    startCallback () {
        this.$axios.post({
          url: `xxx`,
          success: (res) => {
             //此时调用会立即停止转动动画
             this.$refs.myLucky.stop(0)
          }
      })
//如果是放在这里(接口请求外面),动画正常
      this.$refs.myLucky.stop(0)  //转动动画正常
}
// 代码结束
@buuing
Copy link
Owner

buuing commented Aug 18, 2022

可否在 这个demo里 用定时器模拟复现一下这个bug吗

@D-xhao
Copy link
Author

D-xhao commented Aug 19, 2022 via email

@buuing
Copy link
Owner

buuing commented Aug 19, 2022

我就这么说, 100%是你代码的问题, 如果是这个包的旋转逻辑有问题, 这个项目每个月上千的下载量, 早炸锅了, 你还是仔细检查你的代码吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants