zoukankan      html  css  js  c++  java
  • uni-app 配置了tabBar无法显示的问题

    {
        "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
            {
                "path": "pages/index/index",
                "style": {
                    "navigationBarTitleText": "组件"
                }
            },
            {
                "path": "pages/index/index1",
                "style": {
                    "navigationBarTitleText": "接口"
                }
            }
        ],
        "globalStyle": {
            "navigationBarTextStyle": "black",
            "navigationBarTitleText": "uni-app",
            "navigationBarBackgroundColor": "#F8F8F8",
            "backgroundColor": "#F8F8F8"
        },
        "tabBar": {
            "color": "#7A7E83",
            "selectedColor": "#3cc51f",
            "borderStyle": "black",
            "backgroundColor": "#ffffff",
         //注意标红出,不要去改为相对路径,下面这个就是错误的示范,无法显示出tabBar
    "list": [{ "pagePath": "./pages/index/index", "iconPath": "/static/1.png", "selectedIconPath": "/static/2.png", "text": "组件" }, { "pagePath": "./pages/index/index1", "iconPath": "/static/3.png", "selectedIconPath": "/static/4.png", "text": "接口" }] } }

    修改之后:

    {
        "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
            {
                "path": "pages/index/index",
                "style": {
                    "navigationBarTitleText": "组件"
                }
            },
            {
                "path": "pages/index/index1",
                "style": {
                    "navigationBarTitleText": "接口"
                }
            }
        ],
        "globalStyle": {
            "navigationBarTextStyle": "black",
            "navigationBarTitleText": "uni-app",
            "navigationBarBackgroundColor": "#F8F8F8",
            "backgroundColor": "#F8F8F8"
        },
        "tabBar": {
            "color": "#7A7E83",
            "selectedColor": "#3cc51f",
            "borderStyle": "black",
            "backgroundColor": "#ffffff",
         //要修改成与pages里面path的路径一样,点击保存就能正常显示了
    "list": [{ "pagePath": "pages/index/index", "iconPath": "/static/1.png", "selectedIconPath": "/static/2.png", "text": "组件" }, { "pagePath": "pages/index/index1", "iconPath": "/static/3.png", "selectedIconPath": "/static/4.png", "text": "接口" }] } }
  • 相关阅读:
    刷题-力扣-剑指 Offer 22. 链表中倒数第k个节点
    刷题-力扣-617. 合并二叉树
    刷题-力扣-1109. 航班预订统计
    刷题-力扣-606. 根据二叉树创建字符串
    刷题-力扣-563. 二叉树的坡度
    扛把子组20191017-8 alpha week 2/2 Scrum立会报告+燃尽图 07
    20191017-7 alpha week 2/2 Scrum立会报告+燃尽图 06
    20191017-6alpha week 2/2 Scrum立会报告+燃尽图 05
    扛把子组20191017-5 alpha week 2/2 Scrum立会报告+燃尽图 04
    记第一次 团建
  • 原文地址:https://www.cnblogs.com/tlfe/p/13595268.html
Copyright © 2011-2022 走看看