MCPcopy Create free account
hub / github.com/ccj-007/easy-lowcode / Button

Function Button

src/editor/Button.tsx:9–27  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

7}
8
9const 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
29export default Button

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected