如何解决如何在Spring Boot Admin自定义UI index.js文件中导入Vuex或eventBus.js文件?
我必须使用Vuex状态管理或eventBus开发Vue组件之间的通信,但是我无法在index.js中导入正确的* .js文件。 Vuex已与npm一起安装。
我尝试过这样的事情:
store.js:
boxplot(mean~station,DSF_moments,col="cyan",ylab ="mean flow [m3/s]",main="Boxplot of mean annual flow for stations at Salt and Verde Rivers",cex=0.5)
index.js:
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export const store = new Vuex.Store({
state: {
status: []
}
});
我收到以下错误:
import Vuex from 'vuex';
import store from './store/store'
SBA.use({
install({vue}) {
vue.use(Vuex)
}
})
SBA.use({
install({Vuex}) {
Vuex.use(store)
}
})
经过一些修改后的结果:
store.js:8 Uncaught TypeError: Cannot read property 'use' of undefined
at eval (store.js:8)
at Module../src/store/store.js (custom.js:1811)
我也尝试了以下操作,但没有任何效果。
Uncaught Error: [vuex] must call Vue.use(Vuex) before creating a store instance
如何正确导入* .js文件?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。