style: $nextTick promise 形式使用
This commit is contained in:
parent
c13b59e5e2
commit
43e4d538cb
|
|
@ -132,16 +132,15 @@ export default {
|
||||||
/**
|
/**
|
||||||
* @description 接收用户在下拉菜单中选中事件
|
* @description 接收用户在下拉菜单中选中事件
|
||||||
*/
|
*/
|
||||||
handleSelect ({ path }) {
|
async handleSelect ({ path }) {
|
||||||
// 如果用户选择的就是当前页面 就直接关闭搜索面板
|
// 如果用户选择的就是当前页面 就直接关闭搜索面板
|
||||||
if (path === this.$route.path) {
|
if (path === this.$route.path) {
|
||||||
this.handleEsc()
|
this.handleEsc()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 用户选择的是其它页面
|
// 用户选择的是其它页面
|
||||||
this.$nextTick(() => {
|
await this.$nextTick()
|
||||||
this.handleMenuSelect(path)
|
this.handleMenuSelect(path)
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @augments 关闭输入框的下拉菜单
|
* @augments 关闭输入框的下拉菜单
|
||||||
|
|
@ -161,11 +160,10 @@ export default {
|
||||||
/**
|
/**
|
||||||
* @augments 接收用户触发的关闭
|
* @augments 接收用户触发的关闭
|
||||||
*/
|
*/
|
||||||
handleEsc () {
|
async handleEsc () {
|
||||||
this.closeSuggestion()
|
this.closeSuggestion()
|
||||||
this.$nextTick(() => {
|
await this.$nextTick()
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePaginationChange (val) {
|
async handlePaginationChange (val) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '分页变化',
|
title: '分页变化',
|
||||||
message: `当前第${val.current}页 共${val.total}条 每页${val.size}条`
|
message: `当前第${val.current}页 共${val.total}条 每页${val.size}条`
|
||||||
|
|
@ -49,9 +49,8 @@ export default {
|
||||||
pageTotal: val.total
|
pageTotal: val.total
|
||||||
}
|
}
|
||||||
// nextTick 只是为了优化示例中 notify 的显示
|
// nextTick 只是为了优化示例中 notify 的显示
|
||||||
this.$nextTick(() => {
|
await this.$nextTick()
|
||||||
this.$refs.header.handleFormSubmit()
|
this.$refs.header.handleFormSubmit()
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleSubmit (form) {
|
handleSubmit (form) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
|
||||||
|
|
@ -82,14 +82,16 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 清空当前页缓存并刷新此页面
|
// 清空当前页缓存并刷新此页面
|
||||||
handleCleanCacheAndRefreshCurrent () {
|
async handleCleanCacheAndRefreshCurrent () {
|
||||||
this.keepAliveRemove(this.$route.fullPath)
|
this.keepAliveRemove(this.$route.fullPath)
|
||||||
this.$nextTick(() => this.$router.replace('/refresh'))
|
await this.$nextTick()
|
||||||
|
this.$router.replace('/refresh')
|
||||||
},
|
},
|
||||||
// 清空所有的缓存并刷新此页面
|
// 清空所有的缓存并刷新此页面
|
||||||
handleCleanCacheAndRefreshAll () {
|
async handleCleanCacheAndRefreshAll () {
|
||||||
this.keepAliveClean()
|
this.keepAliveClean()
|
||||||
this.$nextTick(() => this.$router.replace('/refresh'))
|
await this.$nextTick()
|
||||||
|
this.$router.replace('/refresh')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue