JSON parse解析特殊字符串报错

利用encodeURIComponent方法

		let _arr = JSON.stringify(arr);
        _arr = encodeURIComponent(_arr);
        // console.log(_arr);
        wx.navigateTo({
            url: '../settlement/settlement?arr=' + _arr,
        });
		//另一个页面
		aarr = JSON.parse(decodeURIComponent(options.arr));

猜你喜欢

转载自blog.csdn.net/qq_39512863/article/details/85772780