uniapp-监听自定义跳转
methods
onNavigationBarButtonTap(e) { //监听自定义导航栏按钮跳转页面
uni.navigateTo({
url: 'liShiYuYue'
})
}
导航栏弹框
methods
onNavigationBarButtonTap(e) { //监听自定义导航栏按钮跳转页面
uni.showModal({
title: '是否退出',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '../login'
})
}
}
})
}
page.json
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "蜘蛛招标通",
"titleNView": {
"buttons": [{
"text": "\ue6da",
"fontSrc": "/static/fonts/iconfont.ttf",
"fontSize": "20px",
"width": "24px"
}, {
"text": "退出",
"fontSize": "14px"
}]
}
}
},