Hyphenate a camelCase string. (Vue.js)
/** * Hyphenate a camelCase string. */ var hyphenateRE = /\B([A-Z])/g; var hyphenate = function(str) { return str.replace(hyphenateRE, '-$1').toLowerCase() };