Questions tagged [vuejs-slots]

63 questions
7
votes
0 answers

VueJS - Apply styles to slots wrapping elements

I want to create a Card component using vue that has a header and content section using the vuejs slots api. I am having trouble understanding how I can create a structure in my Card component. The card should contain all the wireframe styles…
synthet1c
  • 6,152
  • 2
  • 24
  • 39
7
votes
1 answer

How to access child component's reactive data in a slot?

Currently, I have a parent component, which renders a child component, and also passes a component (a modal, called Modal.vue) into the child as a slot. Parent.vue
peterjwolski
  • 153
  • 2
  • 10
6
votes
1 answer

VueJS slots not working with Stencil JS components?

I have a Vue 3 application, and a StencilJS component library. One of my Stencil components used a default slot earlier, and it worked well with Vue. Now I introduced named slots in my Stencil component, but the named slots aren't working from Vue…
Rutwick Gangurde
  • 4,772
  • 11
  • 53
  • 87
6
votes
1 answer

Get slot data as a variable in Vue?

I have a component (prism-editor) that only takes code from v-model="code". This means, the code has to be sent to the component through code: Code.vue