We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.0.11
https://codesandbox.io/s/flamboyant-shirley-fy5w6?file=/src/App.vue
Using script setup and a TS generic to react to change events on a select element I get the error "Unterminated JSX contents".
This is the code for the SFC.
<template> <select @change="handleChange"> <option v-for="option in options" :key="option">{{ option }}</option> </select> </template> <script setup lang="ts"> import { defineProps } from "vue"; defineProps<{ options: string[]; }>(); const handleChange = (e: Event) => { console.log((<HTMLSelectElement>e.target).value); }; </script>
It should compile
Internal server error: [@vue/compiler-sfc] Unterminated JSX contents
I think this is a minor bug in the compiler as there are multiple workarounds
const handleChange = (e: Event & { target: HTMLSelectElement }) => { console.log(e.target.value); };
or
const handleChange = (e: Event) => { console.log((e.target as HTMLSelectElement).value); };
The text was updated successfully, but these errors were encountered:
The cast operator in TS is as and it replaces the version you were using a long time ago. Precisely to avoid ambiguity: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#new-tsx-file-extension-and-as-operator
as
Sorry, something went wrong.
No branches or pull requests
Version
3.0.11
Reproduction link
https://codesandbox.io/s/flamboyant-shirley-fy5w6?file=/src/App.vue
Steps to reproduce
Using script setup and a TS generic to react to change events on a select element I get the error "Unterminated JSX contents".
This is the code for the SFC.
What is expected?
It should compile
What is actually happening?
Internal server error: [@vue/compiler-sfc] Unterminated JSX contents
I think this is a minor bug in the compiler as there are multiple workarounds
or
The text was updated successfully, but these errors were encountered: