Skip to content

Commit 6aad5fd

Browse files
committed
fix(sba-icon-button): replace v-on with v-bind and explicitly emit click event to fix event handler warning
1 parent 8b3597e commit 6aad5fd

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

spring-boot-admin-server-ui/src/main/frontend/components/sba-icon-button.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
class="border-none sm:m-1 bg-transparent!"
2020
:title="title"
2121
size="xs"
22-
v-on="$attrs"
22+
v-bind="$attrs"
23+
@click="$emit('click', $event)"
2324
>
2425
<font-awesome-icon :icon="icon" :size="size" :class="iconClass" />
2526
</sba-button>
@@ -49,6 +50,7 @@ export default {
4950
default: null,
5051
},
5152
},
53+
emits: ['click'],
5254
};
5355
</script>
5456

spring-boot-admin-server-ui/src/main/frontend/views/instances/metrics/metric.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ describe('Metric', () => {
1818
plugins: [i18n],
1919
stubs: {
2020
FontAwesomeIcon: true,
21-
/*
22-
To prevent:
23-
[Vue warn]: Wrong type passed as event handler to onClass - did you forget @ or : in front of your prop?
24-
Expected function or array of functions, received type string.
25-
at <SbaButton class="border-none sm:m-1 bg-transparent! self-end" title=null size="xs" ... >
26-
at <SbaIconButton icon="trash" class="self-end" onClick=fn >
27-
at <Anonymous header-sticks-below="#navigation" title="percent.test" >
28-
at <Metric metricName="percent.test" instance= Instance { ... } statisticTypes= { VALUE: 'percent' } ... >
29-
at <VTUROOT>
30-
*/
31-
SbaButton: {
32-
inheritAttrs: false,
33-
template: '<button><slot /></button>',
34-
},
3521
},
3622
},
3723
props: {

0 commit comments

Comments
 (0)