UNPKG

1.39 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3
4/** @ignore */
5type KeyboardAccessoryProps = StandardProps
6
7/** 设置 Input / Textarea 聚焦时键盘上方 CoverView / CoverImage 工具栏视图。需要配置 Taro 插件 `@tarojs/plugin-platform-weapp` 的 `enablekeyboardAccessory` 参数为 `true` 后才能使用,请参考:[#9548](https://github.com/NervJS/taro/issues/9548#issuecomment-891682216)。
8 *
9 * @classification forms
10 * @supported weapp
11 * @example
12 * ```js
13 * // config/index.js
14 * {
15 * // ...
16 * plugins: [
17 * ['@tarojs/plugin-platform-weapp', {
18 * enablekeyboardAccessory: true
19 * }]
20 * ]
21 * }
22 * ```
23 *
24 * ```tsx
25 * class App extends Component {
26 * render () {
27 * return (
28 * <Textarea holdKeyboard="{{true}}">
29 * <KeyboardAccessory className="container" style={{ height: 50 }} >
30 * <CoverView onClick={() => { TODO }} style={{ flex: 1, background: 'green' }}>1</CoverView>
31 * <CoverView onClick={() => { TODO }} style={{ flex: 1, background: 'red' }}>2</CoverView>
32 * </KeyboardAccessory>
33 * </Textarea>
34 * )
35 * }
36 * }
37 * ```
38 * @see https://developers.weixin.qq.com/miniprogram/dev/component/keyboard-accessory.html
39 */
40declare const KeyboardAccessory: ComponentType<KeyboardAccessoryProps>
41
42export { KeyboardAccessory, KeyboardAccessoryProps }