Closed mdoesburg closed 4 months ago
I cannot reproduce the issue, please provide minimal reproducible code or repo to help us be able to investigate it, thanks.
I cannot reproduce the issue, please provide minimal reproducible code or repo to help us be able to investigate it, thanks.
Minimal reproducible code:
<script setup lang="ts">
import { computed } from 'vue';
const props = defineProps<{ toggleEnter: boolean }>();
const eventName = computed(() => (props.toggleEnter ? 'enter' : null));
function handleEvent() {
// noop
}
</script>
<template>
<Transition @[eventName]="handleEvent" />
</template>
Error:
Seems to only be an issue with event handlers on components. Doesn't give me an error on HTML elements.
This bug was initially reported here: https://github.com/vuejs/language-tools/issues/2514
Slightly different TS error, but same result:
null
is not allowed to be used as a dynamic event name to remove the binding.Reference: https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-value-constraints