(props: Props)
| 7 | } |
| 8 | |
| 9 | const Button = (props: Props) => { |
| 10 | const { data, target } = props |
| 11 | const flag = useRef(true) |
| 12 | |
| 13 | const handleClick = () => { |
| 14 | if (target === 'hidden') { |
| 15 | if (flag.current) { |
| 16 | editGlobalObj('style.display', 'none') |
| 17 | } else { |
| 18 | editGlobalObj('style.display', 'block') |
| 19 | } |
| 20 | flag.current = !flag.current |
| 21 | } |
| 22 | } |
| 23 | return ( |
| 24 | <button className='e-button' onClick={handleClick} {...data}> |
| 25 | {data.children ? data.children : '修改'}</button> |
| 26 | ) |
| 27 | } |
| 28 | |
| 29 | export default Button |
nothing calls this directly
no outgoing calls
no test coverage detected