Skip to content

Commit e63676a

Browse files
committed
Update ArrowBtn.vue
add type definitions to defineEmits. disable vue/no-ref-as-operand on line 42 (prevents eslint to chenge elRef to elRef.value)
1 parent 4f6ed35 commit e63676a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/VueDatePicker/components/Common/ArrowBtn.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
tabindex="0"
88
:aria-label="ariaLabel"
99
:aria-disabled="disabled || undefined"
10-
@click="$emit('activate')"
11-
@keydown="checkKeyDown($event, () => $emit('activate'), true)"
10+
@click="emit('activate')"
11+
@keydown="checkKeyDown($event, () => emit('activate'), true)"
1212
>
1313
<span class="dp__inner_nav" :class="{ dp__inner_nav_disabled: disabled }">
1414
<slot />
@@ -17,7 +17,7 @@
1717
</template>
1818

1919
<script lang="ts" setup>
20-
import { onMounted, ref } from 'vue';
20+
import { onMounted, ref, type Ref } from 'vue';
2121
import { checkKeyDown } from '@/utils/util';
2222
2323
defineOptions({
@@ -26,7 +26,10 @@
2626
},
2727
});
2828
29-
const emit = defineEmits(['activate', 'set-ref']);
29+
const emit = defineEmits<{
30+
'activate': []
31+
'set-ref': [i: Ref<HTMLElement | null>]
32+
}>();
3033
3134
defineProps<{
3235
ariaLabel?: string;
@@ -36,5 +39,5 @@
3639
3740
const elRef = ref<HTMLElement | null>(null);
3841
39-
onMounted(() => emit('set-ref', elRef.value));
42+
onMounted(() => emit('set-ref', elRef)); // eslint-disable-line vue/no-ref-as-operand
4043
</script>

0 commit comments

Comments
 (0)