This commit is contained in:
姚宇浩 2024-10-21 09:31:11 +08:00
parent 56ab289db7
commit a6c6ceca29
4 changed files with 15 additions and 18 deletions

View File

@ -15,7 +15,7 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const app = createApp(App)
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
// 引入 vConsole
// import VConsole from "vconsole";
@ -23,9 +23,9 @@ pinia.use(piniaPluginPersistedstate);
// const vConsole = new VConsole();
app.use(pinia)
app.use(router)
app
.use(router)
.use(ElementPlus, {
locale: zhCn,
})
.mount("#app");
app.mount("#app");

View File

@ -1,13 +0,0 @@
/* eslint-disable no-case-declarations */
import { defineStore } from "pinia";
export const Stored = defineStore("Stored", {
// 需要pinia持久化处
state: () => {
return {
url:""
};
},
//设置持久化
persist: true ,//持久化开启 或者下面配置
});

12
src/stores/store.js Normal file
View File

@ -0,0 +1,12 @@
import { defineStore } from 'pinia';
export const useStore = defineStore('store', {
state: () => ({
count: 0,
}),
actions: {
increment() {
this.count++;
},
},
});

View File

@ -2,8 +2,6 @@ import axios from "axios";
import { ElMessage } from "element-plus";
import tools from "@/utils/tools";
import router from "../router";
// import { Stored } from "@/stores";
// const store=Stored();
axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/'
axios.defaults.timeout = 120000;