testcase
This commit is contained in:
parent
534a2c6f53
commit
922d54f38f
|
|
@ -13,6 +13,7 @@
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"echarts": "^5.3.3",
|
"echarts": "^5.3.3",
|
||||||
"pinia": "^2.0.18",
|
"pinia": "^2.0.18",
|
||||||
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-echarts": "^6.2.3",
|
"vue-echarts": "^6.2.3",
|
||||||
"vue-router": "^4.1.3"
|
"vue-router": "^4.1.3"
|
||||||
|
|
@ -8096,6 +8097,46 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pinia-plugin-persist": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/pinia-plugin-persist/-/pinia-plugin-persist-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-M4hBBd8fz/GgNmUPaaUsC29y1M09lqbXrMAHcusVoU8xlQi1TqgkWnnhvMikZwr7Le/hVyMx8KUcumGGrR6GVw==",
|
||||||
|
"dependencies": {
|
||||||
|
"vue-demi": "^0.12.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@vue/composition-api": "^1.0.0",
|
||||||
|
"pinia": "^2.0.0",
|
||||||
|
"vue": "^2.0.0 || >=3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@vue/composition-api": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pinia-plugin-persist/node_modules/vue-demi": {
|
||||||
|
"version": "0.12.5",
|
||||||
|
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.12.5.tgz",
|
||||||
|
"integrity": "sha512-BREuTgTYlUr0zw0EZn3hnhC3I6gPWv+Kwh4MCih6QcAeaTlaIX0DwOVN0wHej7hSvDPecz4jygy/idsgKfW58Q==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"bin": {
|
||||||
|
"vue-demi-fix": "bin/vue-demi-fix.js",
|
||||||
|
"vue-demi-switch": "bin/vue-demi-switch.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@vue/composition-api": "^1.0.0-rc.1",
|
||||||
|
"vue": "^3.0.0-0 || ^2.6.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@vue/composition-api": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pinia/node_modules/vue-demi": {
|
"node_modules/pinia/node_modules/vue-demi": {
|
||||||
"version": "0.13.7",
|
"version": "0.13.7",
|
||||||
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.7.tgz",
|
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.7.tgz",
|
||||||
|
|
@ -17539,6 +17580,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pinia-plugin-persist": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/pinia-plugin-persist/-/pinia-plugin-persist-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-M4hBBd8fz/GgNmUPaaUsC29y1M09lqbXrMAHcusVoU8xlQi1TqgkWnnhvMikZwr7Le/hVyMx8KUcumGGrR6GVw==",
|
||||||
|
"requires": {
|
||||||
|
"vue-demi": "^0.12.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"vue-demi": {
|
||||||
|
"version": "0.12.5",
|
||||||
|
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.12.5.tgz",
|
||||||
|
"integrity": "sha512-BREuTgTYlUr0zw0EZn3hnhC3I6gPWv+Kwh4MCih6QcAeaTlaIX0DwOVN0wHej7hSvDPecz4jygy/idsgKfW58Q==",
|
||||||
|
"requires": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"pkg-dir": {
|
"pkg-dir": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
"resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"echarts": "^5.3.3",
|
"echarts": "^5.3.3",
|
||||||
"pinia": "^2.0.18",
|
"pinia": "^2.0.18",
|
||||||
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-echarts": "^6.2.3",
|
"vue-echarts": "^6.2.3",
|
||||||
"vue-router": "^4.1.3"
|
"vue-router": "^4.1.3"
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import "echarts"
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
import {createPinia} from "pinia";
|
import {createPinia} from "pinia";
|
||||||
const pina = createPinia()
|
const pina = createPinia()
|
||||||
|
import piniaPluginPersist from 'pinia-plugin-persist'
|
||||||
|
pina.use(piniaPluginPersist)
|
||||||
app.component("Echarts",Echarts)
|
app.component("Echarts",Echarts)
|
||||||
app.use(Antd)
|
app.use(Antd)
|
||||||
app.use(pina)
|
app.use(pina)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import {defineStore} from "pinia";
|
import {defineStore} from "pinia";
|
||||||
|
|
||||||
const useStore = defineStore("mon",{
|
const useStore = defineStore("mon",{
|
||||||
state(){
|
state(){
|
||||||
return {
|
return {
|
||||||
|
|
@ -9,6 +10,13 @@ const useStore = defineStore("mon",{
|
||||||
Update(username){
|
Update(username){
|
||||||
this.username = username
|
this.username = username
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
persist: {
|
||||||
|
enabled: true,
|
||||||
|
strategies: [{
|
||||||
|
key: "user",
|
||||||
|
storage: localStorage
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue