小程序--页面跳转

1、点击事件

2、导航API

bug:事件多次执行 解决方案:开发工具完全关闭重启启动

< view class= 'moto-container' bindtap= "onTap">
< text class= 'moto'>开启小程序之旅 </ text >
</ view >

Page({
onTap: function(){
wx.navigateTo({
url: '../posts/post',
});
}
})
'bindtap="onTap'----bind 事件绑定不会阻止冒泡事件向上冒泡, catch 事件绑定可以阻止冒泡事件向上冒泡。

猜你喜欢

转载自blog.csdn.net/lsy__lsy/article/details/80416219
今日推荐