Skip to content

Commit

Permalink
fix ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jan 22, 2024
1 parent 4a6df46 commit 4cbaed6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions code/renderers/vue3/src/__tests__/Button.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<template>
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
<button
type="button"
:class="classes"
:style="style"
@change="emit('myChangeEvent', 0)"
@click="emit('myClickEvent', 0)"
>
{{ label }}
</button>
</template>

<script lang="ts" setup>
Expand All @@ -12,6 +20,10 @@ const props = withDefaults(
* The label of the button
*/
label: string;
/**
* Whether the button is disabled
*/
disabled: boolean;
/**
* primary or secondary button
*/
Expand All @@ -29,7 +41,8 @@ const props = withDefaults(
);
const emit = defineEmits<{
(e: 'click', id: number): void;
(e: 'myChangeEvent', id: number): void;
(e: 'myClickEvent', id: number): void;
}>();
const classes = computed(() => ({
Expand All @@ -42,8 +55,4 @@ const classes = computed(() => ({
const style = computed(() => ({
backgroundColor: props.backgroundColor,
}));
const onClick = () => {
emit('click', 1);
};
</script>

0 comments on commit 4cbaed6

Please sign in to comment.