## OPScan 扫描输入组件

- 点击空格切换输入框
- Enter 回车触发回调

·API

| 参数             | 说明                      | 类型                     | 默认值   |
| ---------------- | ------------------------- | ------------------------ | -------- |
| defaultValue     | 默认值                    | string                   | -        |
| defaultShowInput | 默认展示输入框            | boolean                  | false    |
| placeholder      | 组件文字                  | string                   | ''       |
| size             | 扫码框大小                | large、medium、small     | large    |
| manual           | 是否允许手输/复制粘贴条码 | boolean                  | true     |
| onEnter          | 扫码/回车时触发函数       | Function                 | ()=>void |
| className        | 自定义类名                | string                   | -        |
| style            | 自定义内敛样式            | React.CSSProperties      | -        |
| prefix           | 前缀                      | React.ReactNode \ boolen | -        |

```jsx
import React, { useState } from 'react';
import { Button, Icon } from '@alife/cn-ui';
import ReactDOM from 'react-dom';
import { OPScan } from '../src/view';
// 全局注册，onEnter回调，可用于一些固定业务场景，比如每次onEnter需要关闭error弹框。
OPScan.addGlobalEnterEvent(() => {
  console.log('you can do someting in each onEnter callback of each instance');
});

const TestScanHeader = () => {
  return (
    <div>
      <OPScan
        placeholder='扫拣选单/运单'
        onEnter={(v) => {
          console.log('enter', v);
        }}
      />
      <OPScan placeholder='扫拣选单/运单' prefix={false} />
      <OPScan
        placeholder='扫拣选单/运单'
        onEnter={(v) => {
          console.log(v);
        }}
        onFocus={() => {
          console.log('focus');
        }}
        onBlur={() => {
          console.log('blur');
        }}
        prefix='我是前缀'
        hasToggle={false}
      />
    </div>
  );
};

ReactDOM.render(<TestScanHeader />, mountNode);
```

```css

```
