mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-14 20:08:48 +08:00
Fixed: #175 || gallery page keep-alive
This commit is contained in:
@@ -64,7 +64,12 @@
|
||||
class="main-wrapper"
|
||||
:class="{ 'darwin': os === 'darwin' }">
|
||||
<transition name="picgo-fade" mode="out-in">
|
||||
<router-view :key="$route.params ? $route.params.type : $route.path"></router-view>
|
||||
<keep-alive>
|
||||
<router-view v-if="$route.meta.keepAlive"></router-view>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<transition name="picgo-fade" mode="out-in">
|
||||
<router-view :key="$route.path" v-if="!$route.meta.keepAlive"></router-view>
|
||||
</transition>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -296,7 +301,7 @@ $darwinBg = transparentify(#172426, #000, 0.7)
|
||||
opacity 0
|
||||
&-enter-active,
|
||||
&-leave-active
|
||||
transition opacity 100ms linear
|
||||
transition all 100ms linear
|
||||
.view-title
|
||||
color #eee
|
||||
font-size 20px
|
||||
|
||||
@@ -139,8 +139,14 @@ export default {
|
||||
picBed: []
|
||||
}
|
||||
},
|
||||
beforeRouteEnter (to, from, next) {
|
||||
next(vm => {
|
||||
vm.getGallery()
|
||||
vm.getPasteStyle()
|
||||
vm.getPicBeds()
|
||||
})
|
||||
},
|
||||
created () {
|
||||
this.getGallery()
|
||||
this.$electron.ipcRenderer.on('updateGallery', (event) => {
|
||||
this.$nextTick(() => {
|
||||
this.filterList = this.getGallery()
|
||||
@@ -148,8 +154,6 @@ export default {
|
||||
})
|
||||
this.$electron.ipcRenderer.send('getPicBeds')
|
||||
this.$electron.ipcRenderer.on('getPicBeds', this.getPicBeds)
|
||||
this.getPasteStyle()
|
||||
this.getPicBeds()
|
||||
},
|
||||
computed: {
|
||||
filterList: {
|
||||
@@ -368,6 +372,8 @@ export default {
|
||||
transition all .2s ease-in-out
|
||||
&.active
|
||||
transform: rotate(180deg)
|
||||
#gallery-view
|
||||
height 100%
|
||||
.item-base
|
||||
background #2E2E2E
|
||||
text-align center
|
||||
|
||||
@@ -78,7 +78,10 @@ export default new Router({
|
||||
{
|
||||
path: 'gallery',
|
||||
component: require('@/pages/Gallery').default,
|
||||
name: 'gallery'
|
||||
name: 'gallery',
|
||||
meta: {
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'setting',
|
||||
|
||||
Reference in New Issue
Block a user