uniapp隐藏自带顶部

全部隐藏

pages.json中

{
        ......
	"globalStyle": {
                 ......
		"navigationStyle": "custom"
                ......
	}
        ......
}

.

部分平台隐藏,比如小程序显示顶部,h5页面隐藏顶部

方法1 推荐

pages.json 文件中中

{
        ......
	"globalStyle": {
                 ......
		// #ifdef H5
		"navigationStyle": "custom",
		// #endif
		// #ifndef H5
		"navigationStyle": "default",
		// #endif
                ......
	}
        ......
}

.

方法2

// pages.json中
{
        ......
	"globalStyle": {
                 ......
		"navigationStyle": "default"
                ......
	}
        ......
}

// App.vue中设置全局样式
/* #ifdef H5 */
    uni-page-head {
        display: none;
    }
/* #endif */

LW放下的博客
请先登录后发表评论
  • latest comments
  • 总共0条评论