1 router/index.js
对要隐藏的路由中加入 meta: { navShow: false}
export default new Router({
routes: [
{
path: '/',
component: Home
},
{
path: '/home',
component: Home
},
{
path: '/payment',
name: 'Payment',
component: Payment,
meta: { navShow: false}
}
]
})
2 在底部导航栏加入 v-show="$route.meta.navShow==undefined||$route.meta.navShow"
<template>
<div id="tab-bar" v-show="$route.meta.navShow==undefined||$route.meta.navShow">
<mt-tabbar v-model="selected" v-show="isShow" fixed class="border-1px-top">
<mt-tab-item id="home">
<img :src="img1" slot="icon">首页
</mt-tab-item>
<mt-tab-item id="serve">
<img :src="img2" slot="icon">服务
</mt-tab-item>
<mt-tab-item id="lock">
<img :src="img3" style="margin:-20px;" width="48px">
</mt-tab-item>
<mt-tab-item id="post">
<img :src="img4" slot="icon">社区
</mt-tab-item>
<mt-tab-item id="me">
<img :src="img5" slot="icon">我的
</mt-tab-item>
</mt-tabbar>
</div>
</template>
<style>
mintui+vue2 子页面隐藏底部导航栏
猜你喜欢
转载自blog.csdn.net/lucasxt/article/details/82219987
今日推荐
周排行