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

在微信小游戏环境中滚动会报错 #36

Open
wangjunxiao0207 opened this issue Jan 13, 2023 · 0 comments
Open

在微信小游戏环境中滚动会报错 #36

wangjunxiao0207 opened this issue Jan 13, 2023 · 0 comments

Comments

@wangjunxiao0207
Copy link

wangjunxiao0207 commented Jan 13, 2023

错误如下:

VM540 WAGame.js:1 ReferenceError: Event is not defined
    at List._onTouchStart (List.ts:1351)
    at CallbacksInvoker.emit (callbacks-invoker.ts:344)
    at NodeEventProcessor.dispatchEvent (node-event-processor.ts:288)

错误代码:
image
错误原因:
没有从cc导入Event,默认的Event是个dom事件对象,在小游戏环境中是没有dom的。
解决方式:
增加代码如下import { Event } from "cc"就可以额

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

No branches or pull requests

1 participant