日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)百度小程序教程:navigator頁面導(dǎo)航
  • navigator 頁面導(dǎo)航
    • 屬性說明
      • target 有效值
      • version 有效值
      • open-type 有效值
    • 示例
      • 代碼示例
      • 說明
    • 常見問題
      • Q:請問下如何關(guān)閉小程序?

    navigator 頁面導(dǎo)航

    解釋:頁面鏈接,控制小程序的跳轉(zhuǎn),既可在當(dāng)前小程序內(nèi)部進(jìn)行跳轉(zhuǎn),也可跳轉(zhuǎn)至其他小程序。navigator的子節(jié)點(diǎn)背景色應(yīng)為透明色。

    屬性說明

    屬性名 類型 默認(rèn)值 必填 說明 最低版本

    target

    String

    self

    在哪個目標(biāo)上發(fā)生跳轉(zhuǎn),默認(rèn)當(dāng)前小程序,有效值 self/miniProgram

    2.5.2
    低版本請做兼容性處理

    url

    String

    應(yīng)用內(nèi)的跳轉(zhuǎn)鏈接

    -

    open-type

    String

    navigate

    跳轉(zhuǎn)方式

    -

    delta

    Number

    當(dāng) open-type 為navigateBack時有效,表示回退的層數(shù)

    -

    app-id

    String

    當(dāng)target=”miniProgram”時有效,要打開的小程序 App Key (小程序后臺設(shè)置-開發(fā)設(shè)置中)

    2.5.2
    低版本請做兼容性處理

    path

    String

    當(dāng)target=”miniProgram”時有效,打開的頁面路徑,如果為空則打開首頁

    2.5.2
    低版本請做兼容性處理

    extra-data

    Object

    當(dāng)target=”miniProgram”時有效,需要傳遞給目標(biāo)小程序的數(shù)據(jù),目標(biāo)小程序可在 App.onLaunch、App.onShow 中獲取到這份數(shù)據(jù)

    2.5.2
    低版本請做兼容性處理

    version

    String

    release

    當(dāng)target=”miniProgram”時有效,要打開的小程序版本,有效值 develop(開發(fā)版),trial(體驗(yàn)版),release(正式版),僅在當(dāng)前小程序?yàn)殚_發(fā)版或體驗(yàn)版時此參數(shù)有效;如果當(dāng)前小程序是正式版,則打開的小程序必定是正式版

    2.5.2
    低版本請做兼容性處理

    hover-class

    String

    navigator-hover

    指定點(diǎn)擊時的樣式類,當(dāng)hover-class=”none”時,沒有點(diǎn)擊態(tài)效果

    hover-stop-propagation

    Boolean

    false

    指定是否阻止本節(jié)點(diǎn)的祖先節(jié)點(diǎn)出現(xiàn)點(diǎn)擊態(tài)

    -

    hover-start-time

    Number

    50

    按住后多久出現(xiàn)點(diǎn)擊態(tài)(單位:毫秒)

    -

    hover-stay-time

    Number

    600

    手指松開后點(diǎn)擊態(tài)保留時間(單位:毫秒)

    -

    bindsuccess

    String

    當(dāng)target=”miniProgram”時有效,跳轉(zhuǎn)小程序成功

    2.5.2
    低版本請做兼容性處理

    bindfail

    String

    當(dāng)target=”miniProgram”時有效,跳轉(zhuǎn)小程序失敗

    2.5.2
    低版本請做兼容性處理

    bindcomplete

    String

    當(dāng)target=”miniProgram”時有效,跳轉(zhuǎn)小程序完成

    2.5.2
    低版本請做兼容性處理

    target 有效值

    說明
    self 當(dāng)前小程序
    miniProgram 跳轉(zhuǎn)到另一個小程序

    version 有效值

    說明
    develop 開發(fā)版
    trial 體驗(yàn)版
    release 正式版

    open-type 有效值

    說明 最低版本

    navigate

    保留當(dāng)前頁面,跳轉(zhuǎn)到應(yīng)用內(nèi)的某個頁面,但是不能跳轉(zhuǎn)到 tabbar 頁面。對應(yīng) swan.navigateTo 的功能

    redirect

    關(guān)閉當(dāng)前頁面,跳轉(zhuǎn)到應(yīng)用內(nèi)的某個頁面。對應(yīng) swan.redirectTo 的功能

    switchTab

    跳轉(zhuǎn)到 tabBar 頁面,并關(guān)閉其他所有非 tabBar 頁面。對應(yīng) swan.switchTab 的功能

    navigateBack

    關(guān)閉當(dāng)前頁面,返回上一頁面或多級頁面。對應(yīng) swan.navigateBack 的功能

    reLaunch

    關(guān)閉所有頁面,打開到應(yīng)用內(nèi)的某個頁面。對應(yīng) swan.reLaunch 的功能

    exit

    退出小程序,target=”miniProgram”時生效

    2.5.2

    示例

    跳轉(zhuǎn)編輯工具

    在開發(fā)者工具中打開

    在 WEB IDE 中打開

    掃碼體驗(yàn)

    代碼示例

    請使用百度APP掃碼

    代碼示例

    • SWAN
    • JS
     
     
     
    1. target="self"
    2. open-type="navigate"
    3. url="/component/detail/detail?id=新頁面,點(diǎn)擊左上角返回回到之前頁面"
    4. hover-class="navigator-hover"
    5. hover-start-time="50"
    6. hover-stay-time="600"
    7. hover-stop-propagation="true">
    8. 跳轉(zhuǎn)到新頁面
    9. s-if="{{!isWeb}}"
    10. target="self"
    11. open-type="redirect"
    12. url="/component/detail/detail?id=當(dāng)前頁,點(diǎn)擊左上角返回回到上級菜單"
    13. hover-class="navigator-hover"
    14. hover-start-time="50"
    15. hover-stay-time="600"
    16. hover-stop-propagation="true">
    17. 在當(dāng)前頁打開
    18. s-if="{{!isWeb}}"
    19. target="self"
    20. open-type="navigateBack"
    21. hover-class="navigator-hover"
    22. hover-start-time="50"
    23. hover-stay-time="600"
    24. hover-stop-propagation="true"
    25. delta="1">
    26. 返回上一頁面
    27. s-if="{{!isWeb}}"
    28. target="miniProgram"
    29. open-type="exit">
    30. 退出當(dāng)前小程序
    31. target="self"
    32. open-type="switchTab"
    33. url="/entry/component/component">
    34. 打開一個有Tab的頁面
    35. target="self"
    36. open-type="reLaunch"
    37. url="/component/detail/detail?id=新頁面,點(diǎn)擊左上角返回回到上級菜單">
    38. 關(guān)閉所有頁面打開新頁面
    39. target="miniProgram"
    40. s-if="{{!isWeb}}"
    41. open-type="navigate"
    42. extra-data="extra-data"
    43. app-id="79RKhZ2BTvyyHitg4W3Xle4kkFgwwXyp"
    44. version="release"
    45. bindsuccess="successHandler"
    46. bindfail="failHandler"
    47. bindcomplete="completeHandler">
    48. 打開綁定的小程序

    說明

    navigator-hover默認(rèn)為:

    • CSS
     
     
     
    1. {
    2. background-color: rgba(0, 0, 0, 0.1);
    3. opacity: 0.7;
    4. }

    常見問題

    Q:請問下如何關(guān)閉小程序?

    A:可以通過組件進(jìn)行關(guān)閉當(dāng)前小程序的操作。

    代碼示例

    • SWAN
     
     
     
    1. 退出當(dāng)前小程序

    當(dāng)前名稱:創(chuàng)新互聯(lián)百度小程序教程:navigator頁面導(dǎo)航
    文章來源:http://www.dlmjj.cn/article/dpgogce.html