A. *_*Lau 5 javascript json node.js visual-studio-code vscode-settings
当我尝试使用绝对路径导入函数,即
const test = require("@/functions")
Run Code Online (Sandbox Code Playgroud)
函数的参数和定义没有定义,只返回:any.
但是,如果我使用相对路径进行相同的导入,即
require("../../functions")
Run Code Online (Sandbox Code Playgroud)
它正确定义它.
我甚至定义了一个jsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
],
"#/*": [
"./*"
]
}
},
}
Run Code Online (Sandbox Code Playgroud)
我期待看到的:
我真正得到的是:
| 归档时间: |
|
| 查看次数: |
163 次 |
| 最近记录: |