Skip to content
New issue

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

Text interpolation doesn't support arrow function return type in TypeScript #6378

Closed
alsotang opened this issue Jul 29, 2022 · 0 comments · Fixed by #6769
Closed

Text interpolation doesn't support arrow function return type in TypeScript #6378

alsotang opened this issue Jul 29, 2022 · 0 comments · Fixed by #6769
Labels

Comments

@alsotang
Copy link

alsotang commented Jul 29, 2022

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-nqcpma?file=src%2FApp.vue&terminal=dev
https://sfc.vuejs.org/#eNp9Us1OwzAMfhWTS1eJtWLH0k1w4w245BI6r8vU/ChxB6jqu+N23To2RA5RPvuz/Tl2J169z44tikKUsQraE0Sk1kOjbL2WgqIUG2m18S4QdBBwBz3sgjOQcFgirbQA0lbORgLCL3qC9cAqIwVt680i0VApC9WeE2KSPl9zVzdcKUZyQhNdiplvYn2b+Q2bxsG7C832IUmlLfNTCyyYAaHxjSJkBHzKrT5OTwba+pagOKqmxaHNQbgU8DLa2bDAFNYbWJw7woxUqJGyMSJlan5J1nVT430/lcrnWn+UPSP4XX8lxey5ElKAst/peP8v6Rx9p2x1p6zML78jHsVpukujfHaIzvIudONUJwevQAGjZbDx1AcsxZ7IxyLP464aNugQMxfqnF9ZaC1pgxlGs/wI7jNi4MQngSykF/0PsYfKiA==

Steps to reproduce

image

What is expected?

arrow function return type should be correct parsed in vue template

What is actually happening?

In the demo code above, when annotating the return type in the arrow function, the dist build results in an empty function.

@input="(e: any): any => (text1 = e.target.value)"
"

// with return type
onInput: _cache[1] || (_cache[1] = ($event) => ((e) => (text1.value = e.target.value)))

// without return type
onInput: _cache[0] || (_cache[0] = (e) => (text1.value = e.target.value))

System Info

No response

Any additional comments?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants