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

本地图片资源的问题 #99

Open
fjswhl opened this issue Nov 13, 2018 · 4 comments
Open

本地图片资源的问题 #99

fjswhl opened this issue Nov 13, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@fjswhl
Copy link

fjswhl commented Nov 13, 2018

现在小程序的样式文件或者 img src 都可以直接引用本地的图片,也就是说,minapp build应该不需要对本地图片资源路径进行修改了, --public_path应该也不需要了, minapp dev也不需要开一个本地服务来serve图片

@fjswhl
Copy link
Author

fjswhl commented Nov 13, 2018

有的时候是在代码里写的图片路径,比如一组 imageSrcs: string[], 在waml里面for循环输出这组,这时候build是不会把这里面用到的图片复制过去的
同理在waml标签里用条件判断输出的image也是无效的

<image src="{{isTrue? 'a.jpg' : 'b.jpg'}}">

所以解决办法还是得minapp build干掉对图片资源进行映射的逻辑,或者加个option

@qiu8310
Copy link
Owner

qiu8310 commented Nov 13, 2018

了解了,谢谢反馈

我来想个办法

@qiu8310 qiu8310 added the enhancement New feature or request label Nov 13, 2018
@fjswhl
Copy link
Author

fjswhl commented Nov 13, 2018

抱歉说错了,样式文件里的还是不能引本地图片。waml 标签存在上述的问题。

@skyline75489
Copy link

这个问题还是挺明显的,表现就是,开发工具模拟器可以正常看到图片,但是使用真机调试,所有的本地图片都无法展示。

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

No branches or pull requests

3 participants