You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use *.vue with `<script lang="tsx"> for SFC, and located a bug(may be) in ts-loader, and issued a PR to fix it. Demo for test is running well.
But there has been some of intellisense and highlight issues:
// if use lang=tsx, the "string" type notation is not highlight, //and this.msg can't be derived to a string type// if use lang=ts, hightlight and type derivation works well, // but this.msg alone is still derived as any and cause an error,// and jsx syntax is not allowed in lang=ts
computed: {
testMsg: function():string{return(thisasany).msg+' powered by typescript & tsx'}},
And in render function, data and computed and maybe others all can't be found on this.
But that seems like only take an effect on *.tsx files, not on *.vue's <script lant="tsx"> region, I had to write above code again in *.vue. This may not be a bug on vetur, but I can't figure out a way to resolve it.
if use lang=tsx, the "string" type notation is not highlight.
I mean the notation : string, not the string content its self. It is brown in my editor under lang=ts, and white under lang=tsx. Finally I found it is the theme problem with different TM scope between lang=tsx and lang=ts
Info
Problem
I tried to use
*.vue
with `<script lang="tsx"> for SFC, and located a bug(may be) in ts-loader, and issued a PR to fix it. Demo for test is running well.But there has been some of intellisense and highlight issues:
And in render function,
data
andcomputed
and maybe others all can't be found onthis
.Another problem is that, I wrote a jsx.d.ts:
But that seems like only take an effect on
*.tsx
files, not on*.vue
's <script lant="tsx"> region, I had to write above code again in*.vue
. This may not be a bug on vetur, but I can't figure out a way to resolve it.Reproducible Case
Test this demo repo.
The text was updated successfully, but these errors were encountered: