大家好!我叫戴向天
QQ群:602504799
如若有不理解的,可加QQ群进行咨询了解
function getEncodeUrl(url = ''){
return url.split('/').map((str)=>/[\u4e00-\u9fa5]+/g.test(str)?encodeURI(str):str).join('/')
}
use method:
getEncodeUrl('http://www.yangchan.com/文件夹/压缩包/test.zip')
Vue file:
<a :href="getEncodeUrl('http://www.yangchan.com/文件夹/压缩包/test.zip')"></a>