ES2020动态引入

ES2020新特性中,允许js文件动态引入,并且不需要模块处理器可直接使用,如:

const a = async (num) => {
    
    
	if (num === 1) {
    
    
		const b = await import('../xx.js')
	}
}
a(1)

猜你喜欢

转载自blog.csdn.net/m0_37797410/article/details/108607778