officert / vue-slideout-panel

Vue JS component for stackable slideout panels
https://officert.github.io/vue-slideout-panel
MIT License
169 stars 30 forks source link

Add support for <slots> #13

Closed BySly closed 5 years ago

BySly commented 6 years ago

Hi. I think that it's too uncomfortable to make different сomponents for parent <slideout-panel> component every time. Maybe we have some way to use <slot> tag to make component more reusable?

officert commented 6 years ago

@BySly I'm open to adding support for <slots>, curious how you guys would like to use it, so I'd love some feedback.

I'm thinking we could have 2 slots 1) Panel Title 2) Panel Body

like this:

screen shot 2018-09-20 at 9 20 10 am

and the API would work something like this:

$this.showPanel({
  titleSlot: `your HTML goes here`,
  bodySlot: `your HTML goes here`
});

Let me know what you think.

BySly commented 6 years ago

@officert yep, that's good idea with title and body.

bmadigan commented 6 years ago

What about using renderless components? Then the user can manipulate the UI as they wish