Documentation de développement de l'applet WeChat
/ 微信小程序?qū)Ш?navigator
微信小程序?qū)Ш?navigator
navigator
頁(yè)面鏈接。
注:navigator-hover
默認(rèn)為 {background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;}
, <navigator/>
的子節(jié)點(diǎn)背景色應(yīng)為透明色
示例代碼:
/** wxss **/ /** 修改默認(rèn)的navigator點(diǎn)擊態(tài) **/ .navigator-hover { color:blue; } /** 自定義其他點(diǎn)擊態(tài)樣式類(lèi) **/ .other-navigator-hover { color:red; }
<!-- sample.wxml --> <view class="btn-area"> <navigator url="navigate?title=navigate" hover-class="navigator-hover">跳轉(zhuǎn)到新頁(yè)面</navigator> <navigator url="redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">在當(dāng)前頁(yè)打開(kāi)</navigator> <navigator url="index" open-type="switchTab" hover-class="other-navigator-hover">切換 Tab</navigator> </view>
<!-- navigator.wxml --> <view style="text-align:center"> {{title}} </view> <view> 點(diǎn)擊左上角返回回到之前頁(yè)面 </view>
<!-- redirect.wxml --> <view style="text-align:center"> {{title}} </view> <view> 點(diǎn)擊左上角返回回到上級(jí)頁(yè)面 </view>
// redirect.js navigator.js Page({ onLoad: function(options) { this.setData({ title: options.title }) } })