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

通过mpvue开发的小程序使用sprite-wxapp,打包后在小程序开发工具中报错 #4

Open
dillonlfy opened this issue Jul 6, 2018 · 2 comments

Comments

@dillonlfy
Copy link

下载sprite-wxapp.js放在src的utils中,如下图:

111

下面是使用时的代码:
222

在微信开发这工具中运行小程序,报错如下:
333

@akira-cn
Copy link
Contributor

akira-cn commented Jul 6, 2018

请问require的路径是正确的吗?加载sprite-wxapp就报错,不加载没事?
看错误信息不太像sprite-wxapp本身执行的问题

@dillonlfy
Copy link
Author

可以了,在mpvue中使用的话也需要通过mpvue安装,不过需要直接安装sprite-wxapp模块,然后在需要的页面通过import引用进来就行了
import { Scene,Sprite, Label } from 'sprite-wxapp/dist/sprite-wxapp'
贴张图吧:
先把sprite-wxapp模块安装一下
111

uc 20180709145235

打印

uc 20180709145448

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

2 participants