|
|
@@ -4,8 +4,16 @@
|
|
|
*/
|
|
|
export const tabbarStore = reactive({
|
|
|
curIdx: uni.getStorageSync('app-tabbar-index') || 0,
|
|
|
+ prevIdx: uni.getStorageSync('app-tabbar-index') || 0,
|
|
|
setCurIdx(idx: number) {
|
|
|
this.curIdx = idx
|
|
|
uni.setStorageSync('app-tabbar-index', idx)
|
|
|
},
|
|
|
+
|
|
|
+ restorePrevIdx() {
|
|
|
+ if (this.prevIdx === this.curIdx)
|
|
|
+ return
|
|
|
+ this.setCurIdx(this.prevIdx)
|
|
|
+ this.prevIdx = uni.getStorageSync('app-tabbar-index') || 0
|
|
|
+ },
|
|
|
})
|