Check out a free preview of the full Advanced Vue.js Features from the Ground Up course:
The "Challenge 6: Dynamically Render Components" Lesson is part of the full, Advanced Vue.js Features from the Ground Up course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge, students iterate through implementations of rendering a component.

Get Unlimited Access Now

Transcript from the "Challenge 6: Dynamically Render Components" Lesson

>> Evan You: So let's move onto the next exercise and it's going to be very similar, but with slightly different requirements. So 3.2. Instead of dynamically rendering tags, we're now trying to dynamically render different components. So the goal is to first implement two very simple components, Foo and Bar, and all that you should render is just Foo and Bar inside a div, and do that with a render function obviously.

[00:00:29] And next we're again going to implement an example component. And this time this example component is going to take an ok prompt. If ok is true, this example component will simply render the Foo component. And if ok is false, it'll render the Bar component. And then in the root component, we want a button that allows us to toggle between Foo and Bar.

[00:00:58] And the boiler plate looks like this.