[英]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.