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

This commit is contained in:
Rhon Joe 2023-07-24 10:31:56 +08:00 committed by GitHub
parent fe747040bc
commit 67d326a558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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