如何使用vue才能實(shí)現(xiàn)頂部菜單欄功能?很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
先看展示結(jié)果:
點(diǎn)擊第一個按鈕,顯示內(nèi)容1 點(diǎn)擊第二個按鈕,展示內(nèi)容2
下面上源碼:注意哦,一定要代碼規(guī)劃,別學(xué)我(⊙o⊙)
<template> <div> <div class="tab-content"> <div class="tab-content1" @click="cur=1" :class="{active:cur==1}"><span>數(shù)據(jù)標(biāo)注</span> </div> <div class="tab-content2" @click="cur=2" :class="{active:cur==2}">案件數(shù)</div> </div> <div class="tab"> <div v-show="cur==1"> <div>內(nèi)容1</div> </div> <div v-show="cur==2"> <div>內(nèi)容2</div> </div> </div> </div> </template> <script> export default { data () { return{ cur:1 } }, methods:{ } } </script> <style scoped> .tab-content .active{ background-color: #194e84 !important; color: #fff; } .tab-content1{ text-align: center; cursor: pointer; width: 150px; height: 30px; border: 1px solid #ccc; } .tab-content2{ margin-top:-30px; text-align: center; cursor: pointer; margin-left:200px; width: 150px; height: 30px; border: 1px solid #ccc; } </style>
本文題目:如何使用vue才能實(shí)現(xiàn)頂部菜單欄功能-創(chuàng)新互聯(lián)
轉(zhuǎn)載來于:http://aaarwkj.com/article26/dgohjg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊、建站公司、網(wǎng)站內(nèi)鏈、面包屑導(dǎo)航、微信公眾號、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容