Skip to content

Commit

Permalink
fix(resolveConfig): when the naming convention of globally passed pro…
Browse files Browse the repository at this point in the history
…p is different from props declaration, it will result in incorrect classification
  • Loading branch information
cloydlau committed Dec 6, 2023
1 parent d380ed5 commit fef24fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resolveConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function resolveConfig(
slots: {},
}

const propsList = Array.isArray(props) ? props : Object.keys(props)
const propsList = (Array.isArray(props) ? props : Object.keys(props)).map(v => kebabToCamel(v))

for (const k in config) {
if (k.startsWith('@')) {
Expand Down Expand Up @@ -74,7 +74,7 @@ export default function resolveConfig(
if (slotName) {
res.slots[slotName] = config[k]
}
} else if (propsList.includes(k)) {
} else if (propsList.includes(kebabToCamel(k))) {
res.props[k] = config[k]
} else {
res.attrs[k] = config[k]
Expand Down

0 comments on commit fef24fa

Please sign in to comment.