其他分享
首页 > 其他分享> > vue学习之------动态组件

vue学习之------动态组件

作者:互联网

vue 提供了一个组件的占位符  ———— <component :is="组件名"></component>,用来实现动态切换组件的显示与隐藏

父组件中:

 


 

如果希望切换组件时,不要销毁组件,可以加上

<keep-alive></keep-alive>

 

标签:vue,占位,组件,切换,------,动态
来源: https://www.cnblogs.com/zhaoyingzhen/p/16593316.html