微信小程序—页面跳转

问题:html

  实现页面跳转:index页面经过按钮跳转到next页面小程序

方法:api

  一、页面index.wxml增长一个按钮  函数

1 // index.wxml
2 <button bindtap="jump">跳转</button>

  二、在index.js中添加跳转逻辑url

1 // 调转函数
2 jump: function () { 3  wx.navigateTo({ 4       url: "../next/next"
5  }) 6 },

  三、重点:spa

    button 表单组件:官方连接:https://developers.weixin.qq.com/miniprogram/dev/component/button.htmlcode

      bindtap  :在组件中绑定一个事件处理函数component

    wx.navigateTo(Object object)  :官方连接:https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.htmlxml

      保留当前页面,跳转到应用内的某个页面。可是不能跳到 tabbar 页面。使用 wx.navigateBack 能够返回到原页面。小程序中页面栈最多十层htm

相关文章
相关标签/搜索