# navigation-bar

Start from base library version 2.9.0. Please remaining backward compatible.

The page navigation bar configuration node specifies some properties of the navigation bar. It can only be page-meta The first node in a component that needs to be used with it.

From this node you can get something like the call wx.setNavigationBarTitle wx.setNavigationBarColor And so on.

attribute type Default value Required Introductions Minimum version
title string no Navigation bar title 2.9.0
loading boolean false no Whether to display in the navigation bar loading Load prompt 2.9.0
front-color string no Navigation bar foreground color value, including on, title, status bar color, support only #ffffff and #000000 2.9.0
background-color string no Navigation bar background color value, valid value is hexadecimal color 2.9.0
color-animation-duration number 0 no Animation duration when changing the color of the navigation bar defaults to 0 (that is, no animation) 2.9.0
color-animation-timing-func string "linear" no When changing the color of the navigation bar, support lineareaseIneaseOut and easeInOut 2.9.0

# sample code

<page-meta>
  <navigation-bar
    title="{{nbTitle}}"
    loading="{{nbLoading}}"
    front-color="{{nbFrontColor}}"
    background-color="{{nbBackgroundColor}}"
    color-animation-duration="2000"
    color-animation-timing-func="easeIn"
  />
</page-meta>
Page({
  data: {
    nbFrontColor: '#000000',
    nbBackgroundColor: '#ffffff',
  },
  onLoad() {
    this.setData({
      nbTitle: 'New title ',
      nbLoading: true,
      nbFrontColor: '#ffffff',
      nbBackgroundColor: '#000000',
    })
  }
})