feat: persistant refresh (no url change)
This commit is contained in:
parent
eb6184f80d
commit
f328d1fb32
2 changed files with 9 additions and 1 deletions
|
|
@ -48,7 +48,13 @@ async function submitFolderForm(value: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(getCabinet)
|
onMounted(async () => {
|
||||||
|
await getCabinet()
|
||||||
|
|
||||||
|
const sessionCurrentPath = sessionStorage.getItem('currentPath')
|
||||||
|
|
||||||
|
if (sessionCurrentPath) await getFolder(sessionCurrentPath)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<section id="header" class="q-px-md q-pt-md q-pb-none">
|
<section id="header" class="q-px-md q-pt-md q-pb-none">
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
||||||
async function getFolder(pathname: string, updateStatus = true) {
|
async function getFolder(pathname: string, updateStatus = true) {
|
||||||
loader.show()
|
loader.show()
|
||||||
|
|
||||||
|
sessionStorage.setItem('currentPath', pathname)
|
||||||
|
|
||||||
const pathArray: string[] = pathname.split('/').filter(Boolean)
|
const pathArray: string[] = pathname.split('/').filter(Boolean)
|
||||||
|
|
||||||
currentDept.value = pathArray.length
|
currentDept.value = pathArray.length
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue