码迷,mamicode.com
首页 > Web开发 > 详细

js、vue: 格式化人名,可用于默认头像

时间:2019-10-23 18:09:43      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:return   username   color   null   use   user   define   val   def   

/**
 * for js、vue: 格式化人名,可用于默认头像
 **/
function userNameFormat(value) { if (typeof(value) == "undefined" || value == null || value == ‘‘) { return value; } if (value.length <= 1) { return value; } value = value.substr((value.length - 2), value.length) return value; };

 

js、vue: 格式化人名,可用于默认头像

标签:return   username   color   null   use   user   define   val   def   

原文地址:https://www.cnblogs.com/sunshouguo/p/11727665.html

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