欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序 wxapp導(dǎo)航 navigator詳解

 更新時(shí)間:2016年10月31日 15:16:07   投稿:lqh  
這篇文章主要介紹了微信小程序 wxapp導(dǎo)航 navigator詳解的相關(guān)資料,并附簡(jiǎn)單實(shí)例代碼,需要的朋友可以參考下

微信小程序 wxapp導(dǎo)航 navigator

最近微信小程序非?;?,朋友圈,微博,論壇等地方都在刷屏,因?yàn)檫@是搞前端的春天,前端工程師可以賺一把了,所以業(yè)余就學(xué)習(xí)了微信小程序的知識(shí),這里記錄下 :

navigator

屬性名 類型 默認(rèn)值 說(shuō)明
url String   應(yīng)用內(nèi)的跳轉(zhuǎn)鏈接
redirect Boolean false 是否關(guān)閉當(dāng)前頁(yè)面
hover-class String navigator-hover 指定點(diǎn)擊時(shí)的樣式類,當(dāng)hover-class="none"時(shí),沒(méi)有點(diǎn)擊態(tài)效果

注: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)樣式類 **/
.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" redirect hover-class="other-navigator-hover">在當(dāng)前頁(yè)打開(kāi)</navigator>
</view>
</navigator>

<!-- 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
  })
 }
})

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論