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

How can I pass the slot #115

Open
drdevelop opened this issue Apr 30, 2024 · 2 comments
Open

How can I pass the slot #115

drdevelop opened this issue Apr 30, 2024 · 2 comments
Labels
Feature Need to do

Comments

@drdevelop
Copy link

pass vue component slot

@drdevelop drdevelop added the Feature Need to do label Apr 30, 2024
@Jenesius
Copy link
Owner

Jenesius commented Apr 30, 2024

Hello, just transferring to the slot will not work. I prefer to create modal windows with the required slots. It looks something like this:

// other-component.vue
<widget-modal>
  <template #header> Test {{label}}</template>
</widget-modal>

And then

import OtherComponent from "./other-component.vue"
openModal(OtherComponent, { label: "Header" })

Also u can try to do something like this:

openModal({
  template: `
  <widget-modal>
    <template #header> Test {{label}}</template>
  </widget-modal>
  `,
  components: {WidgetModal}
}, { label: "Header" })

@drdevelop
Copy link
Author

It looks like additionally bridging a component to pass the slot. It a little trouble. Is there a simple better way to achieve it?

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

No branches or pull requests

2 participants