Today I learn slot in VueJS. It is quite interesting. There are 2 things should consider when working with slots:
- If you don't want to display any tag when render slot, use
templatewith name slot.
- If you write something in Vue component template, it will be the default value to fall back if there is nothing to render in html part.
This is the JSFiddle, hope that I could remember what is it when I look back in future, hehe.
Subscribe to Sang's blog
Get the latest posts delivered right to your inbox