浏览代码

fix(web): fix svg unrecognized props (#631)

Rhon Joe 1 年之前
父节点
当前提交
67d326a558
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      web/app/components/base/icons/utils.ts

+ 1 - 0
web/app/components/base/icons/utils.ts

@@ -15,6 +15,7 @@ export type Attrs = {
 export function normalizeAttrs(attrs: Attrs = {}): Attrs {
   return Object.keys(attrs).reduce((acc: Attrs, key) => {
     const val = attrs[key]
+    key = key.replace(/([-]\w)/g, (g: string) => g[1].toUpperCase())
     switch (key) {
       case 'class':
         acc.className = val