scene
for example, I define a constant file, and in another component reference, it is clear that the constant works, but in the debug tool, why is the introduced constant value undefined,?
code
//constant.js
const Names={man:"zhangsan",woman:"xiaoli"}
export {Names}
//MyComponent.js
import {Names} from "./constant.js"
...
componentDidMount(){
debugger;
}
Action
Open the debugging tool. When you enter didMount, you can use the mouse to look at the value of Names. The undefined, prompt is undefined.
but it"s really okay to use it in your code.
is not just a constant, all import values are invisible.