改善
Kaizen  · Today I Learned by Ville Säävuori

Ignoring Type Errors in Vue Templates

Sometimes you just need to work around type issues by using @ts-ignore or preferably @ts-expect-error. But what if the error shows up in your typed Vue template? Turns out Vue language tools gained a support doing exactly this not too long ago.

You can use @vue-ignore and @vue-expect-error like so:

<!-- @vue-ignore -->
<HelloWorld :msg="wrongType" />

<!-- @vue-expect-error -->
<HelloWorld :msg="wrongType" />