wx.previewImage 会改变原数据

时间:2021-05-06

wx.previewImage预览图片会改变原数据

解决办法,获取原数据时调用 concat() 方法

showImages: function (e) {
        let index = e.currentTarget.dataset.index;
        let urls = this.data.images.concat();
        for (let i in urls) {
            urls[i] = formatLink(urls[i]);
        }
        wx.previewImage({
            current: urls[index],
            urls: urls
        });
}