当前位置:网站首页>Applet global configuration

Applet global configuration

2022-07-05 20:26:00 'wx

In the applet root directory app.json File is the global configuration file of the applet . Common configuration items are as follows :

1.pages

         Record the storage path of all pages of the current applet

2.window

         Set the appearance of the applet window globally

3.tabBar

         Set the at the bottom of the applet tarBar effect

4.style

Whether to enable the new component style

2. understand window Common configuration items of nodes

Property name

type

The default value is

explain

navigationBarTitleText

String

character string

Navigation bar title text content

navigationBarBackgroundColor

HexColor

#000000

Navigation bar background color , Such as  #000000

navigationBarTextStyle

String

white

Navigation bar Title Color , Support only  

black / white

backgroundColor

HexColor

#ffffff

Background color of window

backgroundTextStyle

String

dark

The drop-down  loading  The style of , Support only  

dark / light

enablePullDownRefresh

Boolean

false

Enable pull-down refresh globally

onReachBottomDistance

Number

50

The trigger time interval of the bottom pull event on the page

Distance from the bottom of the page , Unit is px

  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#bfa",
    "navigationBarTitleText": "wx",
    "navigationBarTextStyle":"black",
    "backgroundColor": "#bfa",
    "enablePullDownRefresh": true
 
  },

 

3.tabBar

        tabBar It is a common page effect in mobile applications , It is used to realize the fast switching of multiple pages (tabBar It can only be done by 2-5 individual tab Tab , Only the bottom tabBar Will show icon Icon )

tabBar6 Components

        

tabBar Configuration item of node

attribute

type

Required

The default value is

describe

position

String

no

bottom

tabBar  The location of , Support only  

bottom/top

borderStyle

String

no

black

tabBar  The color of the top border , Support only  

black/white

color

HexColor

no

tab  The default of the text on ( Not selected )

Color

selectedColor

HexColor

no

tab  The color of the selected text on

backgroundColor

HexColor

no

tabBar  Background color of

list

Array

yes

tab  List of tabs ,

least  2  individual 、 most  5  individual  tab

 

 "tabBar": {
    "list":[
      {
        "pagePath": "pages/home/home",
        "text": " Home page ",
        "iconPath": "/images/home.png",
        "selectedIconPath": "/images/home-active.png"
      },
      {
        "pagePath": "pages/message/message",
        "text": " news ",
        "iconPath": "/images/message.png",
        "selectedIconPath": "/images/message-active.png"
      },
      {
        "pagePath": "pages/contact/contact",
        "text": " Contact us ",
        "iconPath": "/images/contact.png",
        "selectedIconPath": "/images/contact-active.png"
      }
    ]
  },

  Every tab Configuration options for item

attribute

type

Required

describe

pagePath

String

yes

Page path , The page must be in  pages  Predefined in

text

String

yes

tab  Text displayed on

iconPath

String

no

Icon path when not selected ; When  postion  by  top  when , No display  icon

selectedIconPath

String

no

Icon path when selected ; When  postion  by  top  when , No display  icon

 

原网站

版权声明
本文为['wx]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207052018302827.html