export与export default均可用于导出常量、函数、文件、模块等,有什么区别呢?
//a.js export const name = "猫宝宝"; export function cat() { } //b.js import { name , cat} from 'a'//导入的时候需要花括号
//a.js const name = "猫宝宝"; function cat() { } export default { name, cat } //b.js import custom from 'a'; //导入的时候没有花括号,custom是自定义的名称,此处custom = {name,cat} console.info(custom.name) console.info(custom.cat)
//a.js const name = "猫宝宝"; export default name //b.js import name from 'a' //导入的时候没有花括号
//导入的时候没有花括号
如对本文有疑问, 点击进行留言回复!!
MFC的静态库.lib、动态库.dll(包含引入库.lib)以及Unicode库示例
CTF 刷题记录(一) 白云新闻搜索(手动与自动化SQL注入)
javascript如何使用函数random来实现课堂随机点名方法详解
网友评论