1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-04-26 04:04:08 +08:00

refactor: folders

This commit is contained in:
张传龙
2022-09-18 20:05:40 +08:00
parent bdbe9b8483
commit 6664ae8f7b
45 changed files with 138 additions and 139 deletions

View File

@@ -0,0 +1,29 @@
import { defineStore } from 'pinia'
export const useAppStore = defineStore('app', {
state() {
return {
reloadFlag: true,
collapsed: false,
}
},
actions: {
async reloadPage() {
$loadingBar.start()
this.reloadFlag = false
await nextTick()
this.reloadFlag = true
setTimeout(() => {
document.documentElement.scrollTo({ left: 0, top: 0 })
$loadingBar.finish()
}, 100)
},
switchCollapsed() {
this.collapsed = !this.collapsed
},
setCollapsed(collapsed) {
this.collapsed = collapsed
},
},
})