mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 10:59:42 +08:00
uuid 有值时不设置, 没值自动设置
This commit is contained in:
parent
ad89f8a587
commit
6be6213fb9
@ -20,6 +20,19 @@ export default class UUIDControl extends React.Component<
|
||||
> {
|
||||
constructor(props: FormControlProps) {
|
||||
super(props);
|
||||
if (!props.value) {
|
||||
this.setValue();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(props: FormControlProps) {
|
||||
if (!props.value) {
|
||||
this.setValue();
|
||||
}
|
||||
}
|
||||
|
||||
setValue() {
|
||||
const props = this.props;
|
||||
let uuid = uuidv4();
|
||||
if (props.length) {
|
||||
uuid = uuid.substring(0, props.length);
|
||||
|
Loading…
Reference in New Issue
Block a user