function camelCase(string){ // Support: IE9-11+ return string.replace( /-([a-z])/g, function( all, letter ) { return letter.toUpperCase(); }); } camelCase('hello-vue-text') "helloVueText"
function camelCase(string){ // Support: IE9-11+ return string.replace( /-([a-z])/g, function( all, letter ) { return letter.toUpperCase(); }); } camelCase('hello-vue-text') "helloVueText"
转载于:https://www.cnblogs.com/zhujiasheng/p/8423537.html