Answer the question
In order to leave comments, you need to log in
Why doesn't dynamic import work?
Hello!
1 and 3 are displayed in the console, 2 is not displayed, please tell me why the import is not performed?
loadData(){
console.log("1")
let name = 'file1'
let data = []
import('../files/' + name + '.js').then(module => {console.log('2');data=module.default})
console.log("3")
return data
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question