Skip to content

Commit

Permalink
fix(compiler-core): transform kebab case props to camelcase on slots (c…
Browse files Browse the repository at this point in the history
…lose vuejs#2488)
  • Loading branch information
edison1105 committed Nov 10, 2020
1 parent 126cbcc commit 1ce4110
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions packages/compiler-core/src/transforms/transformSlotOutlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,19 @@ export function processSlotOutlet(
const propsWithoutName = name
? node.props.filter(p => p !== name)
: node.props

//#2488
propsWithoutName.forEach(prop => {
const arg = (prop as any).arg
if (arg) {
arg.content = camelize(arg.content)
}
})

if (propsWithoutName.length > 0) {
const { props, directives } = buildProps(node, context, propsWithoutName)
slotProps = props

//#2488
if (
slotProps &&
(slotProps as any).properties &&
(slotProps as any).properties.length > 0
) {
for (let i = 0; i < (slotProps as any).properties.length; i++) {
const prop = (slotProps as any).properties[i]
prop.key.content = camelize(prop.key.content)
}
}

if (directives.length) {
context.onError(
createCompilerError(
Expand Down

0 comments on commit 1ce4110

Please sign in to comment.