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