1.在pages.js中配置相应页面的路由
{
"path": "pages/eventStatistics/eventStatistics",
"style": {
"navigationBarTitleText": "事件统计",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": { // 配置按钮
"buttons": [
{
"text": "\ue562",
"fontSrc": "/static/uni.ttf",
"fontSize": "22px",
"marginRight":"20px",
"color": "#000000"
}
]
}
}
}
}
2.绑定事件:
methods: {
onBackPress(e){
// 返回按钮
console.log(e)
},
// 刚添加的右侧按钮
onNavigationBarButtonTap(e){
console.log(e);
}
}