ES6常用语法介绍
模块化
导出1个:export default xxx
引入一个:import xxx from ‘文件路径’
导出多个:export x1 export x2
引入多个:import { x1, x2 } from ‘文件路径’
/* util1.js */
export default {
a: 100
}
/* util2.js */
export function fn1() {
alert('fn1')
}
export function fn2() {
alert('f
转载
2021-01-20 10:35:10 ·
93 阅读 ·
0 评论