is packaged with webpack. In the original code, the dynamically generated class name is in eval, and the class comes from another package, outgoing defined
look at the typed main.js file under development, and the webpack will be renamed _ * _ js__WEBPACK_IMPORTED_MODULE_0__. It is difficult to solve this problem without changing the original code structure.
related code (for example, it"s really more complex than this)
/ / Please paste the code text below (do not replace the code with pictures)
File 1 "nono.js"
let nono={
name:"nono",
sex:"male"
};
export default nono;
File 2 "kiki.js"
let kiki={
name:"kiki",
sex:"female"
}
export default kiki;
File 3 (entry file) "index.js"
import nono from "./nono.js";
import kiki from "./kiki.js";
let arr=["nono","kiki"];
let selectclass=eval(arr[0]);
console.log(selectclass);
The