[英]How can I fix variables of an array of objects being undefined when being imported from a json file?
[英]In VScode, how do I open a file from the line it's being imported on?
有多種方法。
我喜歡最后一個捷徑。 它很容易到達。
您正在查看的模塊有可能是 commonJS 模塊。 您可以在.jsonconfig
文件中創建或添加以下設置。
設置/添加條目“模塊”:“CommonJS”或設置“模塊”:“Node16”
{
"compilerOptions": {
"baseUrl": "src",
"module": "Node16"
},
"include": [
"src"
, "public/src" ]
}
或者
{
"compilerOptions": {
"baseUrl": "src",
"module": "CommonJS"
},
"include": [
"src"
, "public/src" ]
}
希望這可以幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.