Subscribe on changes!

kebab case props on slots are not transformed to camelcase

avatar
Oct 26th 2020

Version

3.0.2

Reproduction link

https://codesandbox.io/s/vue-3-slot-props-cl5xj?file=/src/App.vue

Steps to reproduce

Open https://codesandbox.io/s/vue-3-slot-props-cl5xj?file=/src/App.vue and you'll see that <template #object> slot will render value of props.hasBeenClicked. Clicking on "Click me" button also works as expected and re-renders new value.

Nothing of this works when I use boolean value directly. Same goes for string and maybe other primitive type values.

What is expected?

Boolean prop should work same as object prop. I'd expect it to work same as in Vue 2: https://codesandbox.io/s/vue-2-slot-props-rv3vb?file=/src/App.vue

What is actually happening?

Boolean and string props don't work until they are wrapped in an object.

avatar
Oct 26th 2020

It looks like a casing problem, using <slot name="boolean" :hasBeenClicked="hasBeenClicked"></slot> works

avatar
Oct 26th 2020

@posva I see. Actually very similar issue happens with $emit() – please see this sandbox & open console. I suspect it will be fixed in same PR so I didn't open new issue.

avatar
Oct 26th 2020

There is already another issue opened about events casing I think

avatar
Oct 26th 2020

For posterity: $emit is fixed when you use latest @vue/compiler-sfc as described in https://github.com/vuejs/vue-next/issues/2429