[bug反馈]wxml 中 style 指向的文件路径 在不同设备中解析不同

小程序 文章 2021-03-12 10:01 349 0 全屏看文

AI助手支持GPT4.0

[bug反馈]wxml 中 style 指向的文件路径 在不同设备中解析不同[bug feedback] The file path pointed to by style in wxml is parsed differently in different devices

[bug反馈]wxml 中 style 指向的文件路径 在不同设备中解析不同
框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 工具 1.05.2102010 2.15.0 2.16.0

// 模拟器中有效, 真机无效

style="background-image: url('/images/testUseCard.png');"

// 真机中有效, 模拟器无效

style="background-image: url('images/testUseCard.png');"


Framework type problem type terminal type wechat version basic library version applet bug tool 1.05.2102010 2.15.0 2.16.0 / / valid in simulator, invalid in real machine/ testUseCard.png '; "/ / valid in real machine, invalid in simulator style =" background image: URL ('images')/ testUseCard.png ');"

回答:

Brother斌🎈:

小程序background-image是不能用本地文件的

詹迪克:

人生投资者:

应该是路径问题。可以看看style文件与wxml文件所在目录。

-EOF-

AI助手支持GPT4.0