Closed RSS1102 closed 2 years ago
You should write it like this let name: string | number = '123'
.
By the way, String
shoud be 'string'.
You should write it like this
let name: string | number = '123'
.By the way,
String
shoud be 'string'.
OK,This is my mistake. My main question is to ask the difference between installing typescript
and not.
The above figure is just to prove that I have not installed typescript
, and I can still make type judgment.
I don't quite understand the difference between whether to install or not.(To determine if I want to install typescript
as well)
thanks.
If you install typescript
, you can control the version of typescript.
If you do not install it, it will invoke global typescript or a version of typescript invoked by another package.
If you don't want typescript type check, write it like this:
<script setup>
// just remove lang="ts" in script
</script>
ok,Thank you very much for your answer.
Does this need to be installed again?
2.I do not install
typescript
, but I still have type verification.