Skip to main content

Questions tagged [vuejs-slots]

The tag has no usage guidance.

1 vote
1 answer
23 views

How can I use a vue component in a named slot which is created outside of the template?

I have a Vue SFC Playground My display and display-two component need access to a data provided by provider. The computation of this data is expensive and provider should only exist if needed. display-...
Eric G's user avatar
  • 661
1 vote
1 answer
56 views

TypeError: Converting circular structure to JSON when accessing $slot data from a Child component in VueJS 3

Problem: <pre>{{ $slots.title() }}</pre> is not printing out the expected object. My parent component ModalView.vue <script setup> import { ref } from 'vue' import Modal from '@/...
Leon Gaban's user avatar
  • 38.9k
0 votes
2 answers
81 views

Update data in child component obtained by $slots

I'm using VueJS 3.4.25 and options API for this. So I have these two components defined like this: // ComponentA <template> ... <div ref="componentA"> <slot></slot> ...
Kevin Kopf's user avatar
  • 13.9k
0 votes
1 answer
41 views

How can a container change the CSS display property of a child in the default slots?

I have a vue playground. The container component needs to be able to control the CSS display property of an unknown number of children in the default slot. I assume the child components will need to ...
Eric G's user avatar
  • 661
0 votes
1 answer
76 views

How can I call an exposed function of a vue component in a default slot?

I have a vue playground. ChildA and ChildB both expose a function called interfaceFunction. I can call this function from App by getting a reference to the component. With the reference, I can call ...
Eric G's user avatar
  • 661
2 votes
1 answer
70 views

How can a container change the display of a child in the default slots?

I have a vue playground. The container component needs to be able to control the display status of an unknown number of children in the default slot. I assume the child components will need to hold a ...
Eric G's user avatar
  • 661
1 vote
1 answer
424 views

In Storybook 8.0.6, Vue 3.4, Typescript - How do I populate a Vue component slot with different subcomponents from a story?

I'm using Vue 3 and have a component which needs to show a variety of different sub-components, depending on context. Using a slot here is the correct answer in Vue3 to achieve this. I'm using ...
Toby Hope's user avatar
1 vote
1 answer
373 views

Vue3 Composition API: Error: Codegen node is missing for element/if/for node. Apply appropriate transforms first when using named slots in router-view

I am currently in the process of rewriting my Vue code in all of my apps but am running into a rather annoying error that I cannot seem to decipher. Let me explain to you first what I am trying to do....
Pimv_h's user avatar
  • 420
0 votes
0 answers
88 views

Vue 2.7 using v-slots without <template>

I have a setup of 3 components - Wrapper, Parent, Controls I'm rendering a Parent inside of Wrapper via a slot and I want to be able to render the Controls inside a named v-slot in the Wrapper ...
Simeon Borisov's user avatar
0 votes
1 answer
548 views

vue 3 - how to create slots for every item in a list component so consumer components can render content as they like?

I've built a list component that renders items in a tree-like outline. It receives an array of items. Every item is an object with multiple properties. The text property of the item is used to render ...
João Melo's user avatar
0 votes
0 answers
57 views

VueJS - Remove html inside slot if it's not my component

I have component-a and component-b, the default slot of component-a must render only component-b and other elements with different tags must be removed <component-a> <component-...
NabiMo's user avatar
  • 115
0 votes
0 answers
35 views

Using scoped slots data in component

I'm trying to access the scoped slots data passed from the child in the slot parent. There are numerous examples on how to do that in the template code (https://vuejs.org/guide/components/slots.html#...
orange's user avatar
  • 7,976
0 votes
0 answers
232 views

How to using v-slot in v-calendar and not replace the original template

I want to add a checkbox on a v-calendar event. I'm new to Vuetify. Here is my code: <v-calendar v-model="value" :weekdays="weekday" :type="type" :...
J W's user avatar
  • 1
4 votes
0 answers
232 views

Runtime Error: Slots is undefined after upgrading Vuetify to version 3

I'm attempting to migrate my project to Vue3, and after upgrading Vuetify, I get a runtime error. Whenever I try to load my home page using vue-cli-service serve with the @vue/compat version, the ...
Trevor's user avatar
  • 41
-1 votes
1 answer
788 views

How to make a slot with v-for loop Vue js 3?

I'm expecting to make a v-for loop with slot in a child component. How can I pass the data looped to the child component ? The data uses a table html template. // parent component <template v-...
john's user avatar
  • 25

15 30 50 per page
1
2 3 4 5