export和import

1、引入第三方插件
import echarts from ‘echarts’
import axios from ‘axios’

2、引入工具类
2.1单个引入
import {getList} from ‘./util’;

const getList = (params) => {
return 
}
export getList; 

2.2批量引入
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from “@angular/core”;

3、export 和 export default 
export可以批量导入,需要携带{}
export default 只能导入一个,不需要携带{}

Bookmark the permalink.

Comments are closed.