picPath: function (path, is_hfs) {
if (typeof path != ‘undefined’ && path != ‘’) {
path = unescape(path);
if (is_hfs) {
let arr = path.split(’/’);
if (is_hfs == 1) {
arr[arr.length - 1] = ‘sl_’ + arr.pop();
} else if (is_hfs == 2) {
arr[arr.length - 1] = ‘ssl_’ + arr.pop();
}
path = arr.join(’/’);
}
}
return path;
},
在页面中使用
<image src="{{filter.picPath(item.pic)}}"></image>
报错
Uncaught ReferenceError: unescape is not defined
(anonymous)
怎么使用unescape啊
wxs中不支持unescape,请使用decodeURIComponent。
请阅读wxs文档https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxs/07basiclibrary.html
你好 我试了一下这边unescape是可用的,能不能提供一下代码片段。https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html