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

@ -132,16 +132,15 @@ export default {
/**
* @description 接收用户在下拉菜单中选中事件
*/
handleSelect ({ path }) {
async handleSelect ({ path }) {
//
if (path === this.$route.path) {
this.handleEsc()
return
}
//
this.$nextTick(() => {
this.handleMenuSelect(path)
})
await this.$nextTick()
this.handleMenuSelect(path)
},
/**
* @augments 关闭输入框的下拉菜单
@ -161,11 +160,10 @@ export default {
/**
* @augments 接收用户触发的关闭
*/
handleEsc () {
async handleEsc () {
this.closeSuggestion()
this.$nextTick(() => {
this.$emit('close')
})
await this.$nextTick()
this.$emit('close')
}
}
}

View File

@ -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

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')
}
}
}