import * as xxx from ‘xxx ’ 与import xxx from ‘xxx’区别

import * as 名称 from ‘路径’:

路径里面 只有(export const setToken1=({commit},val)=>{commit("name"{......})};export const setToken2=({commit},val)=>{commit("name"{......})})

会将 若干export导出的内容组合成一个对象返给xxx;
import xxx from ‘xxx’:(export default mutations)只会导出这个默认的对象作为一个对象

猜你喜欢

转载自blog.csdn.net/anwj1020/article/details/86504904
xxx