Summing up:

<!-- Component A -->
<template>
  <div class="A">
    <B>
      <component :is="child_component"></component>
    </B>
  </div>
</template>

<script>
import B from './B.vue';
import Equipment from './Equipment.vue';

export default {
  name: 'A',
  components: { B, Equipment },
  data() {
    return { child_component: 'equipment' };
  }
};
</script>

<!-- Component B -->
<template>
  <div class="B">
    <h1>Some content</h1>
    <slot></slot> <!-- Component C will appear here -->
  </div>
</template>
Answer from Jonatas Walker on Stack Overflow
๐ŸŒ
Vue.js
vuejs.org โ€บ guide โ€บ components โ€บ props
Props | Vue.js
When objects and arrays are passed as props, while the child component cannot mutate the prop binding, it will be able to mutate the object or array's nested properties. This is because in JavaScript objects and arrays are passed by reference, and it is unreasonably expensive for Vue to prevent such mutations.
๐ŸŒ
Vue.js
v2.vuejs.org โ€บ v2 โ€บ guide โ€บ components-props
Props โ€” Vue.js
In these cases, you can list props as an object, where the propertiesโ€™ names and values contain the prop names and types, respectively: This not only documents your component, but will also warn users in the browserโ€™s JavaScript console if they pass the wrong type.
Discussions

Is it possible to pass a component as props and use it in a child Component in Vue?
Instead you need to have your dynamic component in data or computed property so you can use it in a template as a prop. Also note AnotherComponent doesn't need to be declared in components property. More on stackoverflow.com
๐ŸŒ stackoverflow.com
Vue: Components/templates as props
I am currently trying to learn vue and struggling with the whole component concept. Let's say I have some components that define tabs(like browser tabs). This component has a prop called name. S... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Passing components as props
Maybe slots? More on reddit.com
๐ŸŒ r/vuejs
8
6
April 11, 2023
Newbie Question - Vue Component Passing props to function
onclick is a native attr-listener. Use vue @click="openWindow(link)" You can't/shouldn't use window. in More on reddit.com
๐ŸŒ r/vuejs
22
3
July 18, 2024
๐ŸŒ
W3Schools
w3schools.com โ€บ vue โ€บ vue_props.php
Vue Props
Props is a configuration option in Vue. With props we can pass data to the components via custom attributes to the component tag.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-use-props-in-vuejs
How to Use Props in Vue.js
November 7, 2024 - In this article, we have learned what props do and how props works in Vue.js. In summary, we use props to pass down data from the parent components to the child component(s).
๐ŸŒ
KoderHQ
koderhq.com โ€บ tutorial โ€บ vue โ€บ component-prop
Vue.js 3 Component Props Tutorial | KoderHQ
Learn how to pass data from one component to another down the tree with props. We cover how to create and use props, dynamic and default values and more.
Find elsewhere
๐ŸŒ
Michael Thiessen
michaelnthiessen.com โ€บ vue-props-ultimate-guide
How to Use Props in Vue: The Ultimate Guide (with Examples) | Michael Thiessen
And when your co-workers ask you how you know so much, just smile and tell them you're awesome ๐Ÿ˜‰ ยท In this guide we'll cover the most important things about props: ... Plus many more things throughout! ... Props are how we pass variables and other information around between different components.
Top answer
1 of 2
8

If you are trying to inject html in props, you should really be looking at using slots.

https://v2.vuejs.org/v2/guide/components-slots.html

2 of 2
0

The whole point of using components is that you create a separation of concerns. Defining all the layered components in a single line completely defeats that purpose. Create three separate components. One container component like this.

index.vue

<template>
    <tab :name="mycoolname"></tab>
</template>
<script>
    import tab from tab.vue
    export default {
        components: {
            tab
        }
</script>

The name prop you can than use in that template using {{name}}. Than within the tab component, like this:

tab.vue

<template>
    <h1>{{name}}</h1>
    <my-custom-component @click="doStuff()"></my-custom-component>
</template>
<script>
    import my-custom-component from my-custom-component.vue
    export default {
        props: [
            'name'
        ],
        components: {
            my-custom-component
        },
        methods: {
            doStuff () {
                console.log('hooray this totally works')
            }
</script>

I am using separate build files here, but the concept remains the same when you just import vue into your project. Components can contain everything, from a simple div with a <p> inside to a full page. This component system is insanely powerful to keep things organised.

Without webpack it would look something like this:

var myCustomComponent = { 
    template: `fancyHTML`
}

var Tab= {
    components: {
        'my-custom-component': myCustomComponent 
    },
    template: `even more fancy html containing <my-custom-component>`

new Vue({
   el: '#app'
   components: {
      'tab': Tab
    }
})

}
๐ŸŒ
Michael Thiessen
michaelnthiessen.com โ€บ vue-props-vs-data
Props Versus Data in Vue: The Subtle Differences You Need to Know | Michael Thiessen
Props are how you pass this data from a parent component down to a child component. ... In Vue, props (or properties), are the way that we pass data from a parent component down to it's child components.
๐ŸŒ
Teamhood
teamhood.com โ€บ engineering โ€บ vue-js-component-props
Vue.js Component Props: Easy Tips to Make Them Better (2025)
May 23, 2025 - Vue builds a dependency tree to detect when the render function should be reevaluated. The tree is the list of reactive variables used during the render (itโ€™s determined on the dry-run stage). ItemWithRenameById component uses item computed in the template which uses extendedItems getter and itemId prop.
๐ŸŒ
LogRocket
blog.logrocket.com โ€บ home โ€บ how to use props to pass data to child components in vue 3
How to use props to pass data to child components in Vue 3 - LogRocket Blog
October 18, 2024 - In Vue, props are custom attributes that you can register on any component. You define your data on the parent component and give it a value. Then, you go to the child component that needs that data and pass the value to a prop attribute.
๐ŸŒ
Vue Router
router.vuejs.org โ€บ guide โ€บ essentials โ€บ passing-props
Passing Props to Route Components | Vue Router
Using $route or useRoute() in your component creates a tight coupling with the route which limits the flexibility of the component as it can only be used on certain URLs. While this is not necessarily a bad thing, we can decouple this behavior with a props option. ... import User from './User.vue' // these are passed to `createRouter` const routes = [{ path: '/users/:id', component: User }]
๐ŸŒ
W3Schools
w3schools.com โ€บ vue โ€บ ref_objProps.php
Vue $props Object
The $props object represents the props declared in the component, with the current values. Props in Vue is a way to pass values as attributes to child components.
๐ŸŒ
Reddit
reddit.com โ€บ r/vuejs โ€บ passing components as props
r/vuejs on Reddit: Passing components as props
April 11, 2023 -

So I am now working on two projects. One with Vue and one with React.

One thing I really like doing in React is passing components as props, and I find myself wanting to do it in Vue.

Is there an approach for this in Vue?

Thanks!

๐ŸŒ
Arrowhitech
blog.arrowhitech.com โ€บ vue-component-props
Vue component props: The fundamental guide to use it โ€“ Blogs | AHT Tech | Digital Commerce Experience Company
Props are used to pass down state to child components. Learn all about Vue component props through our fundamental guide in this article with AHT Tech
๐ŸŒ
DEV Community
dev.to โ€บ jacobandrewsky โ€บ defining-props-in-vue-2i0b
Defining props in Vue - DEV Community
July 28, 2025 - Props (short for "properties") are a foundational concept in Vue, enabling component reusability and clear data flow between parent and child components.
๐ŸŒ
Vue School
vueschool.io โ€บ lessons โ€บ vue-3-reusable-components-with-props
Reusable Components with Props
In this lesson, we'll see a realistic use case for reusable components and learn about Vue.js 3 component props. Props are custom HTML attributes that we can register on our components, which allow us to pass data to our components. Links ...
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ guide-to-vue-props
Guide to Vue Props
April 7, 2023 - Props can be a crucial concept to understand when working with components in Vue. Props, which stands for properties, enable us to pass data and functionality from one component to another.
๐ŸŒ
GitHub
github.com โ€บ vuejs โ€บ v2.vuejs.org โ€บ blob โ€บ master โ€บ src โ€บ v2 โ€บ guide โ€บ components-props.md
v2.vuejs.org/src/v2/guide/components-props.md at master ยท vuejs/v2.vuejs.org
This not only documents your component, but will also warn users in the browser's JavaScript console if they pass the wrong type. You'll learn much more about type checks and other prop validations further down this page. So far, you've seen props passed a static value, like in: <blog-post title="My journey with Vue...
Author ย  vuejs