-
-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathformError.js
More file actions
48 lines (42 loc) · 992 Bytes
/
formError.js
File metadata and controls
48 lines (42 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { Component } from 'react';
import Tooltip from '../src';
import '../assets/bootstrap.less';
class Test extends Component {
state = {
visible: false,
};
handleDestroy = () => {
this.setState({
destroy: true,
});
};
handleChange = e => {
this.setState({
visible: !e.target.value,
});
};
render() {
if (this.state.destroy) {
return null;
}
return (
<div>
<div style={{ marginTop: 100, marginLeft: 100, marginBottom: 100 }}>
<Tooltip
visible={this.state.visible}
animation="zoom"
trigger={[]}
overlayStyle={{ zIndex: 1000 }}
overlay={<span>required!</span>}
>
<input onChange={this.handleChange} onBlur={this.handleChange} />
</Tooltip>
</div>
<button type="button" onClick={this.handleDestroy}>
destroy
</button>
</div>
);
}
}
export default Test;