码迷,mamicode.com
首页 > 微信 > 详细

vue显示微信用户名称中enjoin表情

时间:2019-01-26 13:59:14      阅读:472      评论:0      收藏:0      [点我收藏+]

标签:UNC   数据   unicode   代码   用户名   名称   raw   sort   ++   

后端做了处理转为了Unicode编码存入数据库,但是取出来没做出来,所以前端就做下简单的处理

转换代码:

function decodeUnicode(str) {
    str = str.replace(/\\/g, "%");
    return unescape(str);
};

computed下的代码:

因为要针对数组中的某一元素进行排序,所以先排序,然后再次对这个数组中的用户名称进行转换

 computed: {

draw_usinfo: function() { return sortKey(this.code_result, ‘times‘) }, draw_user: function() { for(var i=0;i<this.draw_usinfo.length;i++){ this.draw_usinfo[i][‘username‘] = decodeUnicode(this.draw_usinfo[i].username); } return this.draw_usinfo; } },

 

vue显示微信用户名称中enjoin表情

标签:UNC   数据   unicode   代码   用户名   名称   raw   sort   ++   

原文地址:https://www.cnblogs.com/wangyang0210/p/10323211.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!