style: $nextTick promise 形式使用
This commit is contained in:
@@ -38,7 +38,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handlePaginationChange (val) {
|
||||
async handlePaginationChange (val) {
|
||||
this.$notify({
|
||||
title: '分页变化',
|
||||
message: `当前第${val.current}页 共${val.total}条 每页${val.size}条`
|
||||
@@ -49,9 +49,8 @@ export default {
|
||||
pageTotal: val.total
|
||||
}
|
||||
// nextTick 只是为了优化示例中 notify 的显示
|
||||
this.$nextTick(() => {
|
||||
this.$refs.header.handleFormSubmit()
|
||||
})
|
||||
await this.$nextTick()
|
||||
this.$refs.header.handleFormSubmit()
|
||||
},
|
||||
handleSubmit (form) {
|
||||
this.loading = true
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user