页面导航条配置节点,用于指定导航栏的一些属性。只能是 page-meta 组件内的第一个节点,需要配合它一同使用。

属性 类型 默认值 必填 说明 最低版本
title String 导航条标题  
loading Boolean false 是否在导航条显示 loading 加载提示  
front-color String 导航条前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000  
background-color String 导航条背景颜色值  
color-animation-duration Number 0 改变导航栏颜色时的动画时长,默认为 0 (即没有动画效果)  
color-animation-timing-func String "linear" 改变导航栏颜色时的动画方式,支持 linear 、 easeIn 、 easeOut 和 easeInOut  

示例代码:

<!--pages/component/pages/navigation-bar/navigation-bar.mcml-->
<page-meta

root-background-color="blue"
root-font-size="18px"

background-text-style="light"

background-color="#ff0000"
background-color-top="#ff0000"
background-color-bottom="#000000"

page-font-size="20px"
page-style="background-color:white"
page-orientation="{{orientation}}"

scroll-top="{{scrollTop}}"

bindresize="bindevent"
bindscroll="bindevent"
bindscrolldone="bindevent"
>
  <navigation-bar
    title="{{nbTitle}}"
    loading="{{nbLoading}}"
    front-color="{{nbFrontColor}}"
    background-color="{{nbBackgroundColor}}"
    color-animation-duration="2000"
    color-animation-timing-func="easeIn"
  />
</page-meta>
// pages/component/pages/navigation-bar/navigation-bar.js
Page({
  data: {
    nbTitle: 'navigation-bar标题',
    nbLoading: true,
    nbFrontColor: '#ffffff',
    nbBackgroundColor: '#000000'
  }
})

results matching ""

    No results matching ""

    results matching ""

      No results matching ""