新建tabbar.vue
創(chuàng)新互聯(lián)公司長期為近千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為遂溪企業(yè)提供專業(yè)的成都網(wǎng)站制作、成都網(wǎng)站建設(shè)、外貿(mào)營銷網(wǎng)站建設(shè),遂溪網(wǎng)站改版等技術(shù)服務(wù)。擁有10年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。<template> <mt-tabbar v-model="message" fixed> <mt-tab-item id="MainPage"> <img slot="icon" :src="this.atabs[0]"> 主頁 </mt-tab-item> <mt-tab-item id="ShoppingList"> <img slot="icon" v-bind:src="this.atabs[1]"> 積分商城 </mt-tab-item> <mt-tab-item id="GroupList"> <img slot="icon" v-bind:src="this.atabs[2]"> 微社區(qū) </mt-tab-item> <mt-tab-item id="UserCenter"> <img slot="icon" v-bind:src="this.atabs[3]"> 我的 </mt-tab-item> </mt-tabbar> </template> <script> export default { data(){ return{ //選中的tabbar值message為外面頁面?zhèn)魅氲闹祍elected message:this.selected, //這里使用的icon圖標(biāo)為圖片,所以需要加圖片改變的傳入,若使用阿里圖標(biāo),則不用加 atabs:this.tabs, } }, props:{ selected: String, tabs:Array, }, watch: { message: function (val, oldVal) { // 這里就可以通過 val 的值變更來確定去向 switch(val){ case 'MainPage': this.$router.push('/mainpage'); break; case 'ShoppingList': this.$router.push('/shoppinglist'); break; case 'GroupList': this.$router.push('/grouplist'); break; case 'UserCenter': this.$router.push('/usercenter'); break; } } }, } </script>
分享題目:vuemint-uitabbar變組件使用-創(chuàng)新互聯(lián)
文章URL:http://bm7419.com/article24/ceopce.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、電子商務(wù)、域名注冊、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容