mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
修复 qrcode 获取值方式
This commit is contained in:
parent
e13396af12
commit
bb2529504f
@ -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)}>
|
||||
|
Loading…
Reference in New Issue
Block a user