引入持久化插件

main
CTP 2 years ago
parent 5de5bdfb26
commit 6defa160cd

19
package-lock.json generated

@ -33,7 +33,8 @@
"flyio": "^0.6.2", "flyio": "^0.6.2",
"sass": "^1.62.1", "sass": "^1.62.1",
"vue": "^2.6.11", "vue": "^2.6.11",
"vuex": "^3.2.0" "vuex": "^3.2.0",
"vuex-uniapp-persistence": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/types": "^3.3.2", "@dcloudio/types": "^3.3.2",
@ -19348,6 +19349,14 @@
"vue": "^2.0.0" "vue": "^2.0.0"
} }
}, },
"node_modules/vuex-uniapp-persistence": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/vuex-uniapp-persistence/-/vuex-uniapp-persistence-1.0.1.tgz",
"integrity": "sha512-1Ysvg8yf3gpZuzLev5yPkp+ZP1kFcK/m4sAqspeVPFvOsMUEpjhjT/emLBd/eiUhjN8/fmjO7aUcNoU+KvIwSg==",
"dependencies": {
"lodash": "^4.17.21"
}
},
"node_modules/w3c-hr-time": { "node_modules/w3c-hr-time": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
@ -36115,6 +36124,14 @@
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==", "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
"requires": {} "requires": {}
}, },
"vuex-uniapp-persistence": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/vuex-uniapp-persistence/-/vuex-uniapp-persistence-1.0.1.tgz",
"integrity": "sha512-1Ysvg8yf3gpZuzLev5yPkp+ZP1kFcK/m4sAqspeVPFvOsMUEpjhjT/emLBd/eiUhjN8/fmjO7aUcNoU+KvIwSg==",
"requires": {
"lodash": "^4.17.21"
}
},
"w3c-hr-time": { "w3c-hr-time": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",

@ -73,7 +73,8 @@
"flyio": "^0.6.2", "flyio": "^0.6.2",
"sass": "^1.62.1", "sass": "^1.62.1",
"vue": "^2.6.11", "vue": "^2.6.11",
"vuex": "^3.2.0" "vuex": "^3.2.0",
"vuex-uniapp-persistence": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/types": "^3.3.2", "@dcloudio/types": "^3.3.2",

@ -1,12 +1,15 @@
// 页面路径store/index.js // 页面路径store/index.js
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import persistence from 'vuex-uniapp-persistence';
Vue.use(Vuex); //vue的插件机制 Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项 //Vuex.Store 构造器选项
const store = new Vuex.Store({ const store = new Vuex.Store({
// 使用模块
state: {}, state: {},
getters: {}, getters: {},
modules: {}, modules: {},
plugins: [persistence()], //持久化插件
}); });
export default store; export default store;

Loading…
Cancel
Save