ES6 模块化

export(导出)//import(导入)

script   type:'moudle'

1.导出方式一

export{

flag,sum

}

 

export var name='age'
 
export function mul(num,num2){

    return num+num2
}
 
export class Person{
    run(){
        console.log('aaa');
    }

}
 

import{flag} from './xxx.js'

 

posted @ 2021-09-09 22:59  自在如风web  阅读(20)  评论(0)    收藏  举报