Questions tagged [vuejs-slots]
The vuejs-slots tag has no usage guidance.
vuejs-slots
73
questions
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-...
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 '@/...
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>
...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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-...
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#...
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"
:...
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 ...
-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-...