0

I tried to migrate a vue project to a nuxt project. The problem is using store/index.js file.

I copied the origin file into store folder and this error occurs. I could't find the reason. enter image description here

store/index.js

import { createStore } from "vuex";

export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {},
});
4

1 回答 1

1

createStore is a method of Vuex4, which is aimed towards Vue3.
If you want to use Vuex4, you'll need to use Nuxt3 (which is as of today, not 100% production-ready overall but may still be okay for a smaller project IMO).

于 2021-07-27T13:45:55.523 回答