Error in beforeCreate hook: "TypeError: Cannot set property $store of #<Vue> which has only a getter laravel
Error in beforeCreate hook: "TypeError: Cannot set property $store of #<Vue> which has only a getter laravel
我将 laravel 与 vuex 一起使用,我在我的应用程序中成功配置了所有设置,但出现此错误
出现错误:
Error in beforeCreate hook: "TypeError: Cannot set property $store of #<Vue> which has only a getter
还有
app.js:164694 TypeError: Cannot set property $store of #<Vue> which has only a getter
at Vue.vuexInit (app.js:181831)
at invokeWithErrorHandling (app.js:164660)
at callHook (app.js:167011)
at Vue._init (app.js:167789)
at new Vue (app.js:167869)
at Module../resources/js/app.js (app.js:183333)
at __webpack_require__ (app.js:20)
at Object.0 (app.js:190739)
at __webpack_require__ (app.js:20)
at app.js:84
我的 vuex:
import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import actions from './actions'
import mutations from './mutations'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export default new Vuex.Store({
state,
actions,
mutations,
modules: {
},
strict: debug
})
resource/app.js
import store from './store/store'
const app = new Vue({
el: "#app",
store,
)}
我找到了解决方案
Cannot set property $store of #<Vue>
此错误表示无法设置或已被其他函数使用
我已经在我的应用程序中使用了 vue-stash 但由于 vuestash 我无法使用 vuex
所以我卸载并删除了源代码中的所有导入模块
现在开始工作...
我将 laravel 与 vuex 一起使用,我在我的应用程序中成功配置了所有设置,但出现此错误 出现错误:
Error in beforeCreate hook: "TypeError: Cannot set property $store of #<Vue> which has only a getter
还有
app.js:164694 TypeError: Cannot set property $store of #<Vue> which has only a getter
at Vue.vuexInit (app.js:181831)
at invokeWithErrorHandling (app.js:164660)
at callHook (app.js:167011)
at Vue._init (app.js:167789)
at new Vue (app.js:167869)
at Module../resources/js/app.js (app.js:183333)
at __webpack_require__ (app.js:20)
at Object.0 (app.js:190739)
at __webpack_require__ (app.js:20)
at app.js:84
我的 vuex:
import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import actions from './actions'
import mutations from './mutations'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export default new Vuex.Store({
state,
actions,
mutations,
modules: {
},
strict: debug
})
resource/app.js
import store from './store/store'
const app = new Vue({
el: "#app",
store,
)}
我找到了解决方案
Cannot set property $store of #<Vue>
此错误表示无法设置或已被其他函数使用
我已经在我的应用程序中使用了 vue-stash 但由于 vuestash 我无法使用 vuex
所以我卸载并删除了源代码中的所有导入模块
现在开始工作...