修复 qrcode 获取值方式

This commit is contained in:
2betop 2021-06-17 14:30:24 +08:00
parent e13396af12
commit bb2529504f

View File

@ -6,6 +6,7 @@ import {filter} from '../utils/tpl';
// @ts-ignore
import QrCode from 'qrcode.react';
import {BaseSchema, SchemaClassName} from '../Schema';
import {getPropValue} from '../utils/helper';
/**
*
@ -74,13 +75,15 @@ export default class QRCode extends React.Component<QRCodeProps, any> {
foregroundColor,
placeholder,
level,
value,
defaultValue,
data,
classPrefix: ns
} = this.props;
const finalValue = value || filter(defaultValue, data, '| raw');
const finalValue = getPropValue(
this.props,
() => filter(defaultValue, data, '| raw') || undefined
);
return (
<div className={cx(`${ns}QrCode`, className)}>