Js import () asynchronous principle? What is the principle of lazy loading?

clipboard.png

what is the principle of lazy loading?

Mar.20,2021

import () is a syntactic sugar, and the return value is a Promise object, which means that this requires asynchronous processing, and you can get the real module in .then (). Based on this, your screenshot actually looks like this:

  

Asynchronous generally creates script tags dynamically to load the corresponding js

Menu