猿问

当js里有多个export怎么引入?

// mutation-types.js

export const SOME_MUTATION = 'SOME_MUTATION'

export const SOME_MUTATION_1 = 'SOME_MUTATION_1'

我要import引入mutation-types.js,怎么写比较好?

芜湖不芜
浏览 1144回答 1
1回答

MM们

import * as types from 'mutation-types.js'// types.SOME_MUTATION types.SOME_MUTATION_1
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答