Skip to content

configureMenu

描述

自定义底部工具菜单条目

网页应用需要完成鉴权后调用该接口。
点击事件通过onSuccess回调通知。

支持说明

客户端平台WPS协作版本要求
iOS>=3.10.0
Android>=3.10.0
PC>=3.10.0

输入

名称数据类型是否必填描述
paramsobject
∟ itemsarray<object>自定义菜单条目,为空则为清除
∟ ∟ callbackIdstring点击事件回调ID
∟ ∟ textstring菜单条目标题
onSuccessFunction
onErrorFunction

输出

名称类型描述
callbackIdstring事件回调ID,该接口调用成功会返回一个callbackId为null的事件;其它则代表相应的自定义item被点击

示例代码

ts
const params = {
   items: [{
       text:"自定义1",
       callbackId:"custom1"
   }]
}
const onSuccess = (res) => {
   if(res.callbackId == null) {
       //configureMenu方法调用成功
       return;
   }
   switch(res.callbackId) {
       case "custom1":
       //点击了“自定义1”
       break;
   }
}
window.ksoxz_sdk.configureMenu({ params,onSuccess, onError });

错误码

参考:公共错误码