current position:Home>'interface' declarations can only be used in typescript files in Vue 3.0 + ts resolvent

'interface' declarations can only be used in typescript files in Vue 3.0 + ts resolvent

2022-04-29 04:27:42@huihui_ new

First, check whether there is in the label lang=“ts”

<script lang="ts"></script>

If you don't add lang="ts" try , See if the problem is solved , If not solved , Try the following :
 Insert picture description here open setting.json file , find

 "files.associations": {
    
     ".eslintrc": "json",
     "*.vue": "html"
 }

Comment out "*.vue": “html”, as follows :

 "files.associations": {
    
     ".eslintrc": "json",
     //"*.vue": "html"
 }

The problem can be solved

copyright notice
author[@huihui_ new],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/117/202204270551339834.html

Random recommended