Closed elfman closed 2 years ago
修改node_modules里的lucky-wheel.vue源码,在LuckyWheel的初始化参数里,添加beforeDraw, afterDraw两个回调函数,执行ctx.translate后显示正常了。但这肯定不是长久的解决方法,不知这是bug,还是我哪里配错了?
beforeDraw: function () {
ctx.translate(Radius, Radius)
},
afterDraw: function () {
ctx.translate(-Radius, -Radius)
},
你是uniapp编译的h5?
是的
修改ctx.translate
是我以前的方案, 我不知道你从哪看到的, 因为后面我看到编译正常了就删掉了, 建议你检查一下你的hbx版本
这个是一个uniapp的渲染bug, 他会在图片onload之后重置圆心
"@dcloudio/types": "*",
"@dcloudio/uni-automator": "^2.0.0-28620200814003",
"@dcloudio/uni-cli-i18n": "^2.0.0-32920210927002",
"@dcloudio/uni-cli-shared": "^2.0.0-28620200814003",
"@dcloudio/uni-i18n": "^2.0.0-32920210927002",
"@dcloudio/uni-migration": "^2.0.0-28620200814003",
"@dcloudio/uni-template-compiler": "^2.0.0-28620200814003",
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-28620200814003",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-28620200814003",
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-28620200814003",
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-28620200814003",
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-28620200814003",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-plugin-import": "^1.11.0",
"cross-env": "^7.0.2",
"eslint": "^7.7.0",
"eslint-plugin-vue": "^6.2.2",
"jest": "^25.4.0",
"less-loader": "^6.2.0",
"mini-types": "*",
"miniprogram-api-typings": "*",
"postcss-comment": "^2.0.0",
"sass-resources-loader": "^2.1.0",
"vma-assist": "^1.0.52",
"vue-template-compiler": "^2.6.11"
我是用命令行编译的,并没有使用HBuilderX
哦, 那你用cli重新创建一个项目试试, 因为uniapp已经修复过这个问题了
如果新项目可以, 建议你按照新项目的依赖版本去升级一下旧项目
把uniapp所有相关的包都升级到 2.0.1-34720220422002
后就正常了
ok, 新版是好的