Ignore ts type warnings for vue3+ts

. . . . The blogger endured it for more than a year, but decided to ignore him,

The language is not to save developers' development time, but to standardize developers' development specifications. For the whole company, I have a front-end! ! ! ! ! ! ! I can't bear it, what am I doing to myself! ! ! ! (Of course, you have a lot of front-end developers, and it’s another matter if the process needs to be developed collaboratively). The blogger just showed that the combination of vue3 and ts is relatively smooth. Can save development efficiency

        Okay, let’s get down to business. What we need to solve is the following prompt

        like you

let a="";
console.log(a)

        Did he remind you that a is not defined as a string type!!!!!!!!!

        Of course, if it is a big company, I will bear it. I only have one front-end, and I define it for who to see, and I don’t bring other front-ends. In front of me, let a:string="" is very standard

        Until the blogger wrote the following code and gave me an error

var {arr,map}= await conf.fun(1)

        Finally angry! ! ! ! !

        Enough talking nonsense, let's talk about the solution

        It's easy for him not to prompt

        

<script lang="ts">
	// @ts-nocheck
	import {
		Vue,
		Watch,
		Options
	} from "vue-property-decorator";

Do you see it clearly?//@ts-nocheck Add this position is that the code in the current script does not need ts verification

Cancel ignoring the full text // @ts-check See where you want to go to the text and verify that you are adding this.

Ignore if it is a single line // @ts-ignore

Where to add? Add which line of code to cancel the verification. ! ! ! !

async mounted(){
			let m:any=this;
			//@ts-ignore 
			var {arr,map}= await conf.fun();
			
}

Guess you like

Origin blog.csdn.net/xuelang532777032/article/details/127655472