更新记录
1.0.1(2020-12-14) 下载此版本
更新一下iphone的配置
1.0.0(2020-12-08) 下载此版本
完成自定义的底部导航
平台兼容性
xxj-ncapp
Project setup
使用:
template部分:
<template>
<view>
<!-- 小程序和app部分暂不支持component内置标签 -->
<!-- 页面 -->
<home v-if="index==0"></home>
<farm v-if="index==1"></farm>
<shopping v-if="index==2"></shopping>
<mine v-if="index==3"></mine>
<!-- 底部导航 -->
<foo-bar @toIndex="toIndex" :list='list'></foo-bar>
</view>
</template>
js部分:
<script>
import fooBar from '@/components/footBar/index.vue'
import home from './home/index'
import farm from './farm/index'
import shopping from './shopping/index'
import mine from './mine/index'
export default {
components: {
home,
farm,
shopping,
mine,
fooBar
},
data () {
return {
index: 0,
list: [
{
"iconPath": "/static/images/home/home1.png",
"selectedIconPath": "/static/images/home/home11.png",
"text": "首页"
},
{
"iconPath": "/static/images/home/home2.png",
"selectedIconPath": "/static/images/home/home22.png",
"text": "农场"
},
{
"iconPath": "/static/images/home/home3.png",
"selectedIconPath": "/static/images/home/home33.png",
"text": "商城"
},
{
"iconPath": "/static/images/home/home4.png",
"selectedIconPath": "/static/images/home/home44.png",
"text": "我的"
}
],
}
},
methods: {
toIndex (index) {
// index 当前页面的索引
this.index = index
// 根据index判断页面
// 修改自定义导航标题等
},
}
}
</script>