# setBackHandle ^7.10
设置是否监控安卓手机物理返回键功能
# 调用方式
setBackHandle(status)
1
返回 Promise,使用 then/catch 或 await 处理结果。
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| -- | String | Y | -- | on: 打开监控,off: 关闭监控 |
# 接口调用示例
this.$bridge.setBackHandle('on')
1
# 返回参数
| Prop | Type | Default | Description |
|---|---|---|---|
| messageType | String | hardwareBackClick | 按了物理返回键 |
# 接口返回示例
this.$bridge.setBackHandle('on');
globalEvent.addEventListener('receiveMessageFromApp', (data) => {
this.$bridge.log('hardwareBackClick', data);
if (data.messageType === 'hardwareBackClick') {
// 判断是物理返回按键
this.minibarLeftButtonClick();
}
});
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8