Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有没有更有效的方法在javascript中导入/导出模块?_Javascript_Ecmascript 6_Import_Module_Export - Fatal编程技术网

有没有更有效的方法在javascript中导入/导出模块?

有没有更有效的方法在javascript中导入/导出模块?,javascript,ecmascript-6,import,module,export,Javascript,Ecmascript 6,Import,Module,Export,是否有一种更高效的、更少代码的方法来执行这些导入和导出操作? 导入的模块全部导出为默认值 import TemplateInactive from './TemplateInactive' import TemplateRegular from './TemplateRegular' import TemplateSemiUrgent from './TemplateSemiUrgent' import TemplateUrgent from './TemplateUrgent' export

是否有一种更高效的、更少代码的方法来执行这些导入和导出操作? 导入的模块全部导出为
默认值

import TemplateInactive from './TemplateInactive'
import TemplateRegular from './TemplateRegular'
import TemplateSemiUrgent from './TemplateSemiUrgent'
import TemplateUrgent from './TemplateUrgent'

export {
  TemplateInactive,
  TemplateRegular,
  TemplateSemiUrgent,
  TemplateUrgent,
}
像这样谢谢你?

从“/TemplateInactive”导出{默认为TemplateInactive}
从“/TemplateRegular”导出{默认为TemplateRegular}
从“./TemplateSemiUrgent”导出{默认为TemplateSemiUrgent}
从“/TemplateUrgent”导出{默认为TemplateUrgent}

如何加快速度?更少的代码?更少的执行时间?感谢tipInstalling
“@babel/plugin建议导出默认值”
用您的代码实现了这个技巧,谢谢!