Skip to content

Commit c893d1f

Browse files
committed
fix bug
1 parent 5adecde commit c893d1f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ let ctxAssociate = canvasAssociate.getContext('2d')
3535

3636
wx.setPreferredFramesPerSecond(60)
3737

38-
let worker = wx.createWorker('js/worker/index.js')
3938

4039
export default class Main {
4140
constructor () {
@@ -49,7 +48,7 @@ export default class Main {
4948

5049
this.dataBus = window.dataBus
5150

52-
this.worker = worker
51+
this.worker = wx.createWorker('/js/worker/index.js')
5352

5453
this.pluginFuncs = pluginFuncs
5554

@@ -79,6 +78,7 @@ export default class Main {
7978
this.pluginFuncs()
8079

8180
this.loop()
81+
console.log(window.main)
8282
}
8383

8484
loop() {

js/worker/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
let a = 1
1+
worker.onMessage(function (res) {
2+
console.log(res)
3+
})

0 commit comments

Comments
 (0)