mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
commit
e51693e053
@ -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