index.ts 773 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { createApp } from 'vue';
  2. import App from '../App.vue';
  3. import { createPinia } from 'pinia';
  4. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
  5. const pinia = createPinia();
  6. pinia.use(piniaPluginPersistedstate);
  7. let app = createApp(App);
  8. app.use(pinia);
  9. import {
  10. defineStore
  11. } from 'pinia';
  12. export const Store = defineStore({
  13. id: '',
  14. state: () => {
  15. return{
  16. queryMapTables:[],//地图查询表
  17. roleId:'',//用户权限ID
  18. realName:'',//登录账号的用户名
  19. layerID:'',//控制唯一底图加载id
  20. markID:'',//控制标注id
  21. keepAlives:['Map3DMain'],//控制加载缓存页面
  22. userport:'',
  23. token:'',//token
  24. }
  25. },
  26. getters: {
  27. keepAlive(state) {
  28. return state.keepAlives
  29. }
  30. },
  31. actions: {
  32. },
  33. persist: true
  34. })