如何实现一个简易版的vuex持久化工具(2)

import {persistedState} from '../common/tools.js' ... ... // 因为是uni-app小程序,持久化是调用uni.setStorageSync,网页就用localStorage.setItem persistedState({state, setItem: uni.setStorageSync, setDelay: 1000})

源码地址

https://github.com/goblin-pitcher/uniapp-miniprogram

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/749091644739a5adaaee23b0c6d29273.html