配置uni-app导航栏上的搜索框

page下的style选项根据官方文档配置即可

https://uniapp.dcloud.io/collocation/pages?id=pages

 

例子:

{
    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
        {
            "path": "pages/index/index",
            "style": {
                 "app-plus":{
                     "titleNView":{
                         "searchInput":{
                             "align":"center",
                             "backgroundColor":"#eee",
                             "borderRadius":"5px", // 只能用px作单位
                             "placeholder":"请输入内容",
                             "placeholderColor":"#ccc"
                         }
                     }
                 }
            }
        }
    ],
    "globalStyle": {
        "navigationBarTextStyle": "black",
        "navigationBarTitleText": "uni-app",
        "navigationBarBackgroundColor": "#F8F8F8",
        "backgroundColor": "#F8F8F8"
    }
}

 

效果:

 

猜你喜欢

转载自www.cnblogs.com/luguankun/p/11517871.html