场景
useEffect(() => { setCurrentMark([ { ... iconPath: '../../../assets/bg-location.png', ... }, ]); }, [currentLocation]);
[渲染层网络层错误] Failed to load local image resource
[渲染层错误] Uncaught Error: Uncaught TypeError: Cannot read property ‘x’ of undefined
找了很久,有说url格式错误的,有说基础库版本太高了的,基本上能找到的方法我都试过了,还是不行。于是只好自己试探着改一下,没想到成功了。
import MarkerIcon from '../../../assets/bg-location.png' ... iconPath: MarkerIcon , ...
上一篇:微信小程序 wx:if使用