Dynamic Vue.js Components with the component element

Greg Thoman
InstructorGreg Thoman

Share this video with your friends

Send Tweet

You can dynamically switch between components in a template by using the reserved <component> element and dynamically bind to its is attribute. By using <keep-alive> you can tell Vue to keep the component in memory.

~ 4 years ago

Thank you Greg !! Excellent series!!

Phil Anderson
Phil Anderson
~ 2 years ago

Hi Greg - thank you for this series. This is my first Egghead series that I have worked through.

I have created a GitHub repo at https://github.com/philanderson888/vue and followed your lessons through.

In lesson 11 I have worked the lesson through fine but I'm getting two problems on the last lesson here

  1. The keep-alive does not seem to work

  2. I'm getting a Vue warning to avoid mutating the prop 'quantity' directly as it will get overwritten on render.

Are you able to help me at all fix these two problems?

Many thanks



Here's the repo for this last lesson


Phil Anderson
Phil Anderson
~ 2 years ago

PS If you read the README for the repo right through, you will see that I have followed your lessons right through from start to finish.