Skip to content

Commit

Permalink
fix(compiler-core): kebab case props on slots are not transformed to …
Browse files Browse the repository at this point in the history
…camelcase vuejs#2488
  • Loading branch information
edison1105 committed Nov 10, 2020
1 parent ca8276d commit 0f1f56e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/compiler-core/src/transforms/transformSlotOutlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { isSlotOutlet, findProp } from '../utils'
import { buildProps, PropsExpression } from './transformElement'
import { createCompilerError, ErrorCodes } from '../errors'
import { RENDER_SLOT } from '../runtimeHelpers'
import { camelize } from '@vue/shared/'

export const transformSlotOutlet: NodeTransform = (node, context) => {
if (isSlotOutlet(node)) {
Expand Down Expand Up @@ -71,6 +72,19 @@ export function processSlotOutlet(
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 0f1f56e

Please sign in to comment.