• 1:uniapp路由跳转


    1:在当前页面 跳转 其他页面

    1. <navigator url="../middle/middle" hover-class="navigator-hover">
    2. <button type="default">跳转到middle新页面button>
    3. navigator>

                                    

    注意 跳转 得话左上角会有一个返回得箭头,就相当于middle页面只是他的子页面

    2:在当前页面 打开 其他页面

    1. <navigator url="../middle/middle"
    2. open-type="redirect"
    3. hover-class="other-navigator-hover">
    4. <button type="default">在当前页打开button>
    5. navigator>

                                    

     如果是直接打开得话,就相当于是一个全新得页面。

     3:跳转到tab页面

    1. <navigator url="../My/My"
    2. open-type="switchTab"
    3. hover-class="other-navigator-hover">
    4. <button type="default">跳转我的tab页面button>
    5. navigator>

    注意:跳转到tab页面,必须设置open-type="switchTab"

    4:方法跳转

                                                                 

    使用就是绑定点击方法,

    1. uni.navigateTo({
    2. url:"/pages//middle/middle"
    3. })

    5:总结。

    ①:在写三个样例得时候,发现怎么都不能跳转,搜了一下也没找到办法,就去官网看了,结果发现   url中不能跟后缀名,也就是.vue,不能写成  url="../middle/middle.vue" 真的会裂开

    ②:看官方属性。

     ③:open-type 有效值

    ④:注意

    • 跳转tabbar页面,必须设置open-type="switchTab"
    • navigator-hover 默认为 {background-color: rgba(0, 0, 0, 0.1);   opacity:0.7;},  的子节点背景色应为透明色。
    • navigator-open-type属性 如果使用对应的值,则对应值的功能会高于对应跳转路径。
    • app-nvue 平台只有纯nvue项目(render为native)才支持 。非render为native的情况下,nvue暂不支持navigator组件,请使用API跳转。
    • app下退出应用,Android平台可以使用plus.runtime.quit (opens new window)。iOS没有退出应用的概念。
    • uLink组件 (opens new window)是navigator组件的增强版,样式上自带下划线,功能上支持打开在线网页、其他App的schema、mailto发邮件、tel打电话。
  • 相关阅读:
    RKE2 config containerd private registry (rke2配置私有仓库地址)
    java 根据身份证号码判断性别
    学习:原码-反码-补码
    艾美捷C1q天然蛋白化学性质和相关研究方案
    Linux 文件基础
    python永久配置pip下载镜像源方法(window版本)
    比较运算符
    [CISCN2019 华东南赛区]Web11
    Spring之@Repository @Service @Component @Controller的区别和使用场景
    一款强大的子域名收集工具(OneForAll)
  • 原文地址:https://blog.csdn.net/weixin_51472505/article/details/127683654