// mutation-types.js
export const SOME_MUTATION = 'SOME_MUTATION'
export const SOME_MUTATION_1 = 'SOME_MUTATION_1'
我要import引入mutation-types.js,怎么写比较好?
ringa_lee2017-05-19 10:13:30
你可以吧SOME_MUTATION和SOME_MUTATION_1放在一个export的对象里面呀:
let obj = {
SOME_MUTATION : 'SOME_MUTATION',
SOME_MUTATION_1 : 'SOME_MUTATION_1'
}
export obj
给我你的怀抱2017-05-19 10:13:30
引入
import * as types from '../../mutation-types';
使用
types.SOME_MUTATION
types.SOME_MUTATION_1