uniapp中配置midButton並且跳轉到midButton所在頁面


    "tabBar":{
        "color":"#333333",
        "selectedColor":"#2a75f6",
        "backgroundColor":"#f4f1f1",
        "position":"bottom",
        "borderStyle":"white",
        "list":[
            {
                "pagePath":"pages/Home/Home",
                "text":"",
                "iconPath":"static/icon/hands-fill-2.png",
                "selectedIconPath":"static/icon/hands-fill.png"
            },
            {
                "pagePath":"pages/College/College",
                "text":"",
                "iconPath":"static/icon/xueyuan.png",
                "selectedIconPath":"static/icon/xueyuan-2.png"
            },
            {
                "pagePath":"pages/Mine/Log/Log",
                "text":"",
                "iconPath":"static/icon/rizhi-2.png",
                "selectedIconPath":"static/icon/rizhi.png"
            },
            {
                "pagePath":"pages/Mine/Mine",
                "text":"",
                "iconPath":"static/icon/wode.png",
                "selectedIconPath":"static/icon/wode-2.png"
            }
        ],
        "midButton": {
            "width": "60px",
            "height": "60px",
            "iconPath": "static/icon/kongzhitai.png",
            "iconWidth": "40px",
            "text":"控制台",
            "backgroundImage":"static/icon/yuan-2.png"
        }
    },

監聽midButton點擊事件

        // App.vue 中監聽
     onLaunch: function() { // tabbar中間按鈕點擊事件 uni.onTabBarMidButtonTap(function(e){ uni.navigateTo({ url: "/pages/Home/Console/Console", animationType: "slide-in-bottom", // 動畫類型 animationDuration: 150, // 窗口動畫持續時間,單位為 ms fail(err) { console.log(err) } }) }) }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM