Skip to content

Commit

Permalink
fix: Prevent double clicking in Vue 3
Browse files Browse the repository at this point in the history
In Vue 3, click events fall through meaning each event is fired twice
when adding @click prop to the component. Adding emits: ['click'] tells
the component to expect an external click event, therefore preventing
the double event.

Co-Authored-By: 1VinceP <vpalmergraphics@gmail.com>
  • Loading branch information
robcresswell and 1VinceP committed Jul 3, 2022
1 parent 4690879 commit 2f08947
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function renderTemplate(title: string, svgPathData: string, name: string) {
<script>
export default {
name: "${name}Icon",
emits: ['click'],
props: {
title: {
type: String,
Expand Down

0 comments on commit 2f08947

Please sign in to comment.