import { createStore } from 'vuex'
import createPersistedState from "vuex-persistedstate";

import state from '@/store/state'
import getters from '@/store/getters'
import actions from '@/store/actions'
import mutations from '@/store/mutations'

export default createStore({
  state: state,
  getters: getters,
  mutations: mutations,
  actions: actions,
  modules: {
  },
  // 配置插件
  plugins: [
    // 默认储存在localstorage
    createPersistedState({
      // 存储方法
      storage: Window.localStorage,
      // 本地储存名
      key: 'disgital-twin-base',
    })
],
})
