question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regular slot and scoped slot with same name shouldn't be allowed

See original GitHub issue

Version

2.6.10

Reproduction link

https://codepen.io/lee88688/pen/jjPpBm?editors=1010

Steps to reproduce

as seen in codepen, “hello” component have only one slot. but rendered 2 div tag at last. I have a look at Vue’s code renderSlot which seems renderSlot function would treat the normal slot as scoped slot. why it would be like this?

the following code is render function of hello component which is compiled by Vue.compile. _t is renderSlot function. when normal slot and scoped slot in same component the problem above will be present.

(function anonymous() {
    with (this) {
        return _c('div', [_t("default"), _v(" "), _t("default", null, {
            "x": x
        })], 2)
    }
}
)

What is expected?

render just one slot.

What is actually happening?

render one slot twice.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DrKlonkcommented, Jul 9, 2021

We tried to solve this issue with a small group, but we were unable to reproduce it in Vue 3. In the docs for Vue 3 this seems to be using a different approach. We are unsure if this issue is still relevant for Vue 3.

@kerm1it Does your commit fix the issue? If yes, are you planning on turning this into a PR?

Could you please let us know if this is still an issue? If so, we’d like to help find a solution.

If not, it might be worth it to close this issue.

0reactions
kerm1itcommented, Jul 9, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips to Supercharge Your Slots (Named, Scoped, and Dynamic)
Here, we're applying the slots to the Slots component, so they're all directly underneath that component. Just like with a regular slot, you...
Read more >
Slots - Vue.js
Scoped Slots​​ As discussed in Render Scope, slot content does not have access to state in the child component. However, there are cases...
Read more >
The Difference Between Props, Slots and Scoped Slots in Vue.js
PROPS. They are attributes that are exposed to accept data from the parent component. Let's create a component MyMessage with props <template>
Read more >
A Guide to Vue Slots - LearnVue
Simply put, scoped slots allow our slot content in our parent component to have access to data that's only found in the child...
Read more >
API - Vue.js
vm.$scopedSlots · Scoped slot functions are now guaranteed to return an array of VNodes, unless the return value is invalid, in which case...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found