Vue 同一组件重复用,数据被覆盖的问题

时间:2020-05-04 21:12:40   收藏:0   阅读:1071

有时候使用Vue组件需要在页面中多次使用,比如vant的button组件,有时需要显示两个

 

<van-button type="default">默认按钮</van-button>
<van-button type="primary">主要按钮</van-button>

 

但这样的话,第一个按钮会无法显示,使用如下方式就可以解决~

<component is="van-button" type="default">默认按钮</component >
<component is="van-button" type="primary">主要按钮</component >

 

原文:https://www.cnblogs.com/qiuxd/p/12828037.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!