style: $nextTick promise 形式使用

This commit is contained in:
FairyEver
2020-04-21 18:19:13 +08:00
parent c13b59e5e2
commit 43e4d538cb
3 changed files with 15 additions and 16 deletions

View File

@@ -82,14 +82,16 @@ export default {
})
},
// 清空当前页缓存并刷新此页面
handleCleanCacheAndRefreshCurrent () {
async handleCleanCacheAndRefreshCurrent () {
this.keepAliveRemove(this.$route.fullPath)
this.$nextTick(() => this.$router.replace('/refresh'))
await this.$nextTick()
this.$router.replace('/refresh')
},
// 清空所有的缓存并刷新此页面
handleCleanCacheAndRefreshAll () {
async handleCleanCacheAndRefreshAll () {
this.keepAliveClean()
this.$nextTick(() => this.$router.replace('/refresh'))
await this.$nextTick()
this.$router.replace('/refresh')
}
}
}