'f'
mh-two-thousand-and-two
2024-04-12 26f2711ef9461961fb953e2b497bd314ef95e345
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {
  invoke,
  remove
} from 'uni-core/service/bridge'
 
import {
  onMethod
} from '../../platform'
 
let callback
 
onMethod('onKeyboardHeightChange', res => {
  if (callback) {
    invoke(callback, res)
  }
})
 
export function onKeyboardHeightChange (callbackId) {
  // 与微信小程序一致仅保留最后一次监听
  remove(callback)
  callback = callbackId
}
 
export function offKeyboardHeightChange () {
  // 与微信小程序一致移除最后一次监听
  callback = null
}