同步思想-未捕获错误抛出
这段代码,乍一看没啥错误,
async getEthBalance () {
this.loading = true
const eth = await CethAction.getEthBalance(this.account)
this.$message.success('开始获取getEthBalance' + eth)
this.loading = false
},
结合交互,一旦函数抛错处理,loading可能一直为true
优化结果处理
async mint () {
this.loading = true
try {
await CethAction.mint(this.account, '0.1')
} catch (error) {
console.error(error)
} finally {
this.loading = false
}
},