1. 程式人生 > >微信小程式--簡單頁面跳轉

微信小程式--簡單頁面跳轉

微信小程式--簡單頁面跳轉

例如:點選一個text ,跳轉入一個新的頁面blueberry.wxml 首先對text 設定監聽事件  <view bindtap="toast" class="usermotto">     <text class="user-motto">{{motto}}</text>   </view> 然後對該text 設定事件跳轉。   //事件處理函式 點選text   toast: function() {     wx.navigateTo({       url: '../blueberry/blueberry'     })   }, 這裡看到跳轉到一個目錄 blueberry下,展示一個 blueberry.wxml頁面 所以在專案的目錄下建立一個blueberry

同時需要在 app.json 中新增頁面配置
以上供新手朋友們參考。。