How does vue use vuex in customization files?

The

directory structure is as follows: I want to use the data in vuex"s state in axios.js
I print console.log (store) error undefined if you directly introduce import state from". / store/state" , you can get the data in state, but you can"t write it this way. why?

|--src
  |--api
     |--axios.js
  |--store
     |--index.js
     |--state.js
     |--mutations.js
     |--actions.js
  |--components
...

src/api/axios.js

import Vuex from "vuex"
import store from "../store/index.js"
console.log(store)

src/store/index.js

import Vue from "vue"
import Vuex from "vuex"
import state from "./state"
import mutations from "./mutations"
import actions from "./actions"

Vue.use(Vuex)

export default new Vuex.Store({
  state,
  mutations,
  actions,
})
May.28,2022

you can reverse the interface method in api, which is introduced into actions in store and then performs asynchronous operations.

Menu