open-type 跳转方式



<!-- open-type 跳转方式
        1.navigate 默认值 保留当前页面 跳转到应用内的某个页面 但是不能调到tabbar页面
        2.redirect 关闭当前的页面 跳转到应用内的某个页面 但是不跳转到tabbar页面
        3.switchTab跳转到tabBar页面 并关闭其他所有非tabBar页面
        4.reLaunch 关闭所有页面 ,打开到应用内的某个页面

 -->
<!-- index是tabbar页面 -->
<navigator url="/pages/demo6/demo6">轮播图页面</navigator>
<navigator url="/pages/inde/index">轮播图页面</navigator>
<navigator open-type="redirect" url="/pages/demo6/demo6">轮播图页面</navigator>
<navigator open-type="switchTabs" url="/pages/index/index">轮播图页面</navigator>
<navigator open-type="reLaunch" url="/pages/index/index">轮播图页面 reLaunch</navigator>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
uniapp中的button组件提供了open-type属性,用于指定按钮的点击行为。以下是open-type属性的几种取值及其对应的行为: 1. navigate:跳转到指定页面,需在button上添加url属性,如:`<button open-type="navigate" url="/pages/index"></button>` 2. redirect:关闭当前页面,跳转到应用内的某个页面,需在button上添加url属性,如:`<button open-type="redirect" url="/pages/index"></button>` 3. switchTab:跳转到应用内的某个tab页面,需在button上添加url属性,如:`<button open-type="switchTab" url="/pages/index"></button>` 4. reLaunch:关闭所有页面,打开应用内的某个页面,需在button上添加url属性,如:`<button open-type="reLaunch" url="/pages/index"></button>` 5. contact:打开客服会话,需在button上添加session-from属性和app-parameter属性,如:`<button open-type="contact" session-from="uni-app" app-parameter="uni"></button>` 6. share:打开分享面板,需在button上添加share-button属性和share参数,如:`<button open-type="share" share-button="true" share="{title: '分享标题', path: '/pages/index', imageUrl: '/static/logo.png'}"></button>` 7. getUserInfo:获取用户信息,需在button上添加bindgetuserinfo属性,如:`<button open-type="getUserInfo" bindgetuserinfo="onGetUserInfo"></button>` 8. getPhoneNumber:获取用户手机号码,需在button上添加bindgetphonenumber属性,如:`<button open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber"></button>` 9. launchApp:打开外部应用,需在button上添加app-parameter属性和extinfo属性,如:`<button open-type="launchApp" app-parameter="myapp://path?query=xxx" extinfo="{id: 'xxx', type: 'yyy'}"></button>`

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

碑无名

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值