下划线命名转成大驼峰命名 function strToCamel(str){ return str.replace(/(^|_)(w)/g,(m,$1,$2)=>$2.toUpperCase()); }