vue中anync与await使用,方法同步按顺序执行

vue中anync与await使用,方法同步按顺序执行,第1张

methedA: function(row) {
	...
	...
	...
	let _this -= this
	this.findUser(row).then(function(result) {
		_this.ouVal = result
	})
	...
	...
	...
}

async findUser(row) {
	let list = []
	await this.$axios
		.post('/api/user/findUser', params)
		.then(rsp => {
			list = [...rsp.data.list]
		})
		.catch(error => {
		})
	return list
}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1323274.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-12
下一篇 2022-06-12

发表评论

登录后才能评论

评论列表(0条)

保存