This commit is contained in:
zuiidea
2016-10-15 01:25:55 +08:00
parent c95eb1c888
commit 8c12c1690d
6 changed files with 65 additions and 192 deletions
+13 -1
View File
@@ -2,8 +2,20 @@ import config from './config'
import menu from './menu'
import request from './request'
// 连字符转驼峰
String.prototype.hyphenToHump = function () {
return this.replace(/-(\w)/g, function () {
return arguments[1].toUpperCase()
})
}
// 驼峰转连字符
String.prototype.humpToHyphen = function () {
return this.replace(/([A-Z])/g,"-$1").toLowerCase()
}
module.exports = {
config,
menu,
request,
request
}