Alipay JSSDK V3.1.1

ap.hideOptionButton()

隐藏导航栏右侧按钮。

代码示例

<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>

<button id="J_btn_type" class="btn btn-default">显示多个按钮</button>
<button id="J_btn_hide" class="btn btn-default">隐藏 optionButton</button>
<script>
  var btnType = document.querySelector('#J_btn_type');
  var btnHide = document.querySelector('#J_btn_hide');

  btnType.addEventListener('click', function(){
    var items = [
      {
        type: 'user'  
      },
      {
        type: 'settings'  
      }
    ];
    ap.setOptionButton(items);
  });
  btnHide.addEventListener('click', function(){
    ap.hideOptionButton();
  });
</script>