|
@@ -6,7 +6,7 @@ import { code128 } from './drawCode'
|
6
|
6
|
import './style.less'
|
7
|
7
|
|
8
|
8
|
export default (props) => {
|
9
|
|
- const { code, ratio, height } = props
|
|
9
|
+ const { code, ratio, height, codeVisible = true } = props
|
10
|
10
|
|
11
|
11
|
const id = useMemo(() => Math.random().toString(36).substring(2, 10), [])
|
12
|
12
|
const canvasRef = useRef()
|
|
@@ -54,7 +54,9 @@ export default (props) => {
|
54
|
54
|
return (
|
55
|
55
|
<View className='barcode-box'>
|
56
|
56
|
<Canvas style={style} type='2d' id={id}></Canvas>
|
57
|
|
- <CodeText code={code} />
|
|
57
|
+ {
|
|
58
|
+ codeVisible && <CodeText code={code} />
|
|
59
|
+ }
|
58
|
60
|
</View>
|
59
|
61
|
)
|
60
|
62
|
}
|