mc.setNavigationBarButtons([Object] array)

导航栏右侧添加按钮

[Object] array 参数

属性 类型 默认值 必填 说明
title String 按钮文字
color Color 文字颜色
icon String 图片本地路径 ,设置 icon 会覆盖 title
action Function 按钮点击回调函数

示例代码:

mc.setNavigationBarButtons({
  items: [
    {
      title: '选择',
      color: 'blue', 
      action: function () {
        mc.showToast({
          title: '点击了选择',
          icon: 'none'
        });
      }
    },
    {
      title: '选择2', 
      action: function () {
        mc.showToast({
          title: '点击了选择2',
          icon: 'none'
        });
      }
    },
    {
      title: '取消', icon: '/assets/images/clear.png',
      action: function () {
        mc.showToast({
          title: '点击了图标',
          icon: 'none'
        });
      }
    }
  ]
})

results matching ""

    No results matching ""

    results matching ""

      No results matching ""