我在./store.js中定义了我的商店:
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
...
});并希望在我的main.js中设置vue-socket.io:
import { MyVuexStore } from './store.js'
Vue.use(VueSocketio, 'http://localhost:5000', MyVuexStore);但是,由于商店没有名称,所以我不能导入它并将其传递给VueSocketio:
62:46-57“出口'MyVuexStore‘在'./store.js’中找不到
发布于 2017-10-05 07:37:03
我认为如果你使用‘导出默认’,你不会和curley一起导入。试试
import MyVuexStore from './store.js'或将导出更改为
export const MyVuexStore = new Vuex.Store({https://stackoverflow.com/questions/46580135
复制相似问题