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

Do you have any plan to update slot with v-slot directive? #88

Open
purdx opened this issue Apr 6, 2019 · 8 comments
Open

Do you have any plan to update slot with v-slot directive? #88

purdx opened this issue Apr 6, 2019 · 8 comments

Comments

@purdx
Copy link

purdx commented Apr 6, 2019

Popper did not work when I tried to replace slot with v-slot. slot is deprecated in Vue 2.6.0, Do you have any plan to use new syntax (v-slot)?

@superMDguy
Copy link
Contributor

I looked into this a bit, I think it's related to vuejs/vue#5427. This line no longer works

@joelpro2
Copy link

joelpro2 commented Apr 23, 2019

The vue bug is corrected in https://unpkg.com/[email protected]/
#vuejs/vue#9421

@hoopyfroody
Copy link

Still doesn't seem to work.

When I do:

<template v-slot:reference>
    <div class="popover">
        Hover me
    </div>
</template>

It doesn't work.

@john-raymon
Copy link

john-raymon commented Mar 17, 2020

Still doesn't work with new slot syntax ...

In 2.6.0, we introduced a new unified syntax (the v-slot directive) for named and scoped slots. It replaces the slot and slot-scope attributes, which are now deprecated, but have not been removed and are still documented here. The rationale for introducing the new syntax is described in this RFC.

    <Popper trigger="clickToToggle" :options="{ placement: 'top' }">
      <BaseButton @click="toggleMenu" slot="reference">
        <template v-slot:icon>
          <ChecIcon :icon="isOpen ? 'up' : 'down'" />
        </template>
      </BaseButton>
      <BasePopover
        @option-selected="handleSelectOption"
      >
        <!--
          @slot Provide BaseOption instances here
        -->
        <slot />
      </BasePopover>
    </Popper>

@josh7weaver
Copy link

I believe this is due to the fact that elm is undefined on Vnodes with new slot syntax. See this closed issue and the links to comments by Evan etc. vuejs/vue#10450 (comment). Vue-popper won't work with Vue 3 unless you're passing the reference as a prop instead of using the slot.

@SherinBloemendaal
Copy link

I've rewritten the component completly in vue 3.0 composition api style, it works with the new scoped slots (v-slot) directive. I won't send a PR because i don't care about backwards compatibility. If you want a copy, let me know.

@nathanchase
Copy link

I've rewritten the component completly in vue 3.0 composition api style, it works with the new scoped slots (v-slot) directive. I won't send a PR because i don't care about backwards compatibility. If you want a copy, let me know.

I'd love to see this and have it available via npm to use.

@meeds
Copy link

meeds commented Mar 22, 2022

Hello,

I'm facing the same issue.

Any news about a fix ?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants