wxml页面
<view catchtap=‘onTapJump‘ class=‘journey-container‘> <text class=‘journey‘>开启小程序之旅</text> </view>
wxss页面
.journey-container{ margin-top: 200rpx; border: 1px solid #ea5a3c; width: 200rpx; height: 80rpx; border-radius:5px; text-align: center; } .journey{ font-size: 22rpx; font-weight: bold; line-height: 80rpx; color: #ea5a3c; } page{ background-color: #ecc0a8; }
js页面
Page({ onTapJump:function(event){ wx.redirectTo({ url: ‘../posts/posts‘, success:function(){ console.log("jump success"); }, file:function(){ console.log("jump failed"); }, complete:function(){ console.log("jump complete"); } }) } })
效果图:(点击跳转到另一个页面)
原文地址:https://www.cnblogs.com/zwtqf/p/9695333.html
时间: 2024-10-29 21:55:57