微信小程序wx.showToast()自定义图片不显示

wx.showToast({
              title: '提交失败!',
              image: '../../../images/other/warn.png',
              duration: 1500
            });

上述代码在真机和模拟器上图片都是不会显示的,这里image的路劲不可以通过../来指向所在位置
解决方法:

wx.showToast({
              title: '提交失败!',
              image: '/images/other/warn.png',
              duration: 1500
            });

你可能感兴趣的:(微信小程序)