Dynamic Vue.js Components with the component element

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.

Vamshi
Vamshi
~ 8 years ago

Thank you Greg !! Excellent series!!

Phil Anderson
Phil Anderson
~ 5 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

Philip

:)

Here's the repo for this last lesson

https://github.com/philanderson888/vue/blob/master/component-08.html

Phil Anderson
Phil Anderson
~ 5 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.