47 lines
978 B
Plaintext
47 lines
978 B
Plaintext
<template lang="pug">
|
|
#app
|
|
van-nav-bar(:title='navTitle',
|
|
fixed
|
|
left-text='返回',
|
|
right-text='按钮',
|
|
left-arrow='')
|
|
|
|
router-view
|
|
|
|
van-tabbar(v-model='active' @change="onChange")
|
|
van-tabbar-item(v-for="(item,index) in TabBar"
|
|
:icon='item.icon'
|
|
:to="item.href"
|
|
:key="index") {{item.title}}
|
|
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
active: 0,
|
|
navTitle: '首页',
|
|
TabBar: [
|
|
{ title: '首页', icon: 'home-o', href: '/' },
|
|
{ title: '分类', icon: 'search', href: '/class' },
|
|
{ title: '购物车', icon: 'friends-o', href: '/car' },
|
|
{ title: '我的', icon: 'setting-o', href: '/me' },
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
onChange(index) {
|
|
this.navTitle = this.TabBar[index].title
|
|
this.active = index
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less">
|
|
.content {
|
|
margin-top: 46px;
|
|
}
|
|
</style>
|