本例依赖mpvue 2.0
先将 iview weapp 的 dist文件夹复制到项目的 static/iview 下(这个步骤就不赘述了,不懂的可以留言)。
在项目 ( app部分 ) 的 app.vue 中加入:
export default {
onLaunch() {
wx.hideTabBar();
},
//....
}
在页面 ( page部分 ) 的文件夹下新建 main.json 文件,写入:
{
"usingComponents": {
"i-tab-bar": "../../../static/iview/tab-bar/index",
"i-tab-bar-item": "../../../static/iview/tab-bar-item/index"
}
}
在页面文件夹的 index.vue 文件里写入:
<i-tab-bar :fixed="true" current="mine">
<i-tab-bar-item key="remind" icon="remind" current-icon="remind_fill" title="主页"></i-tab-bar-item>
<i-tab-bar-item key="mine" icon="mine" current-icon="mine_fill" title="我的"></i-tab-bar-item>
</i-tab-bar>
网友评论