Skip to content

Commit

Permalink
refactor: simplify event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Feb 6, 2024
1 parent ef12b99 commit 38865c7
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 168 deletions.
Expand Up @@ -203,7 +203,7 @@ export function render(_ctx) {
_prepend(n4, n1)
_insert(n2, n4, n5)
_append(n4, n3)
_on(n4, "click", (...args) => (_ctx.handleClick && _ctx.handleClick(...args)))
_on(n4, "click", () => _ctx.handleClick)
_renderEffect(() => {
_setText(n1, _ctx.count)
_setText(n2, _ctx.count)
Expand Down
Expand Up @@ -11,7 +11,7 @@ export function render(_ctx) {
const n1 = _createFor(() => (_ctx.items), (_block) => {
const n2 = t0()
const { 0: [n3],} = _children(n2)
_on(n3, "click", $event => (_ctx.remove(_block.s[0])))
_on(n3, "click", () => $event => (_ctx.remove(_block.s[0])))
_renderEffect(() => {
const [item] = _block.s
_setText(n3, item)
Expand Down

0 comments on commit 38865c7

Please sign in to comment.