这篇文章主要为大家详细介绍了Vue实现Tab选项卡切换,点击不同标题显示对应图片,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了Vue实现Tab选项卡切换的具体代码,供大家参考,具体内容如下
点击不同的标题显示出相应的图片
代码如下
<title>Document</title> *{ margin: 0px; padding: 0px; } #tab{ width:420px; margin: 20px auto; position: relative; } #tab ul li{ width: 100px; height: 30px; border: 1px solid #6699CC; float: left; list-style: none; text-align: center; line-height: 30px; } #tab ul li:first-child{ border-right: none; /* border-radius: 10px 0px 0px 0px; */ } #tab ul li:last-child{ border-left: none; /* border-radius: 0px 10px 0px 0px; */ } #tab ul .active{ background-color:orange; color:white; } #t<strong>本文来源gao@daima#com搞(%代@#码网</strong>ab div{ width: 415px; position: absolute; top: 32px; display: none; } #tab div img{ width: 350px; /* border-radius:0px 0px 10px 10px; */ } #tab div.current{ display: block; } <div id="tab"> <ul> <li>{{item.text}}</li></ul><div> </div></div>
效果图
以上就是Vue实现Tab选项卡切换的详细内容,更多请关注gaodaima搞代码网其它相关文章!