Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shorthand syntax for v-bind does not work for "name" property in slots #10213

Closed
HighLiuk opened this issue Jan 25, 2024 · 0 comments · Fixed by #10218
Closed

shorthand syntax for v-bind does not work for "name" property in slots #10213

HighLiuk opened this issue Jan 25, 2024 · 0 comments · Fixed by #10218
Labels
has PR A pull request has already been submitted to solve the issue 🔩 p2-edge-case scope: compiler

Comments

@HighLiuk
Copy link

Vue version

3.4.15

Link to minimal reproduction

https://play.vuejs.org/#eNp9kk9PAjEQxb9KUw+rCdk9cEM08Q8HPShRb9bDZhmg2G2bThdIyH53ZwqLEoFb573fbGf6diPvvM+XDciBHGIVtI8CITb+VlldexeieHC1F9PgapHlBReMZ9fKDottA6FURKi9KSNQJcQwNdmyhhslI2BUMunkdJy4YH2nCvHoAIV1dPvcrXZocfjNdDkdD3TZkxErZ6d6li/QWdpjw7SSFdHaQHj1UTuLSg5EctgrjXGr56TF0ECv06s5VN9H9AWuWVNyHAAhLEHJvRfLMANakO3R+wus6bw3azdpDNFnzDdAZxqecYvdN3ZCY//h0rRPKQ1tZx84Wkew2C3FgzLZJl5JSocf6tTqv+P2837qU7alV+ySPfIjTGCqLYyD83j5mXGq2dfV+fzRUJQDRkXxL7L2B3jp0N0=

Steps to reproduce

<!-- App.vue -->
<script setup>
import Component from './Component.vue';
</script>

<template>
  <Component name="test">
    <template #test>
      Does not show
    </template>
  </Component>
</template>

<!-- Component.vue -->
<script setup>
defineProps(['name'])
</script>

<template>
  <slot :name /> <!-- works if :name="name" -->
</template>

What is expected?

It should work as if we wrote :name="name" as of Vue 3.4 which has released this feature with #9451:

https://blog.vuejs.org/posts/vue-3-4#v-bind-same-name-shorthand

What is actually happening?

No slot is shown. No errors in the console.

System Info

No response

Any additional comments?

No response

@sodatea sodatea added scope: compiler 🔩 p2-edge-case has PR A pull request has already been submitted to solve the issue labels Jan 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has PR A pull request has already been submitted to solve the issue 🔩 p2-edge-case scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants