uniapp原生导航栏添加下边框

1、方法一:通过全局样式添加

page::before{
  content: '';
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 2rpx;
  background-color: #f0f0f0;
  z-index: 9999;
}

2、方法二:此方法app端生效

 {
     "path" : "pages/index/index",
	    "style" : {
			"navigationBarTitleText": "首页",
			"app-plus": {    
			  "titleNView": {    
			    "splitLine": {  
			      "color":"#f2f2f2"  
			    }    
			  }    
			}
		}
	},

你可能感兴趣的:(uniapp,uni-app,前端,javascript)