2016-06-09 4 views
0

내 모듈에서 여러 함수와 숫자 상수를 내보내려고합니다. 내 모듈의 내 보낸 모든 속성을 가져올 때 해당 함수가 실제로 가져 오기되지 않습니다.함수의 es6 내보내기가 작동하지 않습니다.

//module1.js 
const func1 = (a) => {console.log(1)}; 
const func2 = (b) => {console.log(2)}; 
const variable1 = 1; 
const variable2 = 2; 

export const exp1 = func1; 
export const exp2 = func2; 
export const exp3 = variable1; 
export const exp4 = variable2; 

.

//anotherFile.js 
import * as module1 from './module1'; 
console.log(JSON.stringify(module1, null, 2));     // {"module1": {"exp3":1, "exp4":2}} 

올바른 가져 오기 기능은 무엇입니까?

답변

0

모든 작품! 내 기능

내 문제가 console.log(JSON.stringify(module1, null, 2)); JSON.stringify이었다을 차단했다

관련 문제