最佳答案
使用 regex (我假设)或其他一些方法,我如何转换这样的内容:
从 marker-image
或 my-example-setting
到 markerImage
或 myExampleSetting
。
我在考虑用 -
分割,然后将连字符 + 1的索引转换为大写。但是它看起来很脏,并且希望在 regex 方面得到一些帮助,从而使代码更清晰。
没有 jQuery..。