button和tabBar都具有跳转到某个页面的功能时,button失效
app.json定义了tabBar的测试按钮跳转到test
{ "pages" :[ "pages/index/index" , "pages/test/test" ], "window" :{ "backgroundTextStyle" : "light" , "navigationBarBackgroundColor" : "#fff" , "navigationBarTitleText" : "WeChat" , "navigationBarTextStyle" : "black" }, "tabBar" : { "list" : [ { "pagePath" : "pages/index/index" , "text" : "首页" }, { "pagePath" : "pages/test/test" , "text" : "测试" } ] } } |
index.js中定义了test按钮跳转到test页面
test: function (){ wx.navigateTo({ url: '../test/test' }) } |
会导致test按钮无法执行跳转代码