Skip to content

Commit

Permalink
fix: pass onClick only if function is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Jan 16, 2024
1 parent d2de676 commit 3dd1261
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/ListView/ListRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
<component
:is="list.options.getRowRoute ? 'router-link' : 'div'"
class="flex cursor-pointer flex-col transition-all duration-300 ease-in-out"
v-bind="
list.options.getRowRoute
? { to: list.options.getRowRoute(row) }
: { onClick: () => list.options.onRowClick(row) }
"
v-bind="{
to: list.options.getRowRoute ? list.options.getRowRoute(row) : undefined,
onClick: list.options.onRowClick
? () => list.options.onRowClick(row)
: undefined,
}"
>
<component
:is="list.options.getRowRoute ? 'template' : 'button'"
Expand Down

0 comments on commit 3dd1261

Please sign in to comment.