async await實際用法
async handleSubmit() { await this.handleSubmitReport() // 1 await this.handleSubmitEdit() // 2 this.showSuccess = true // 3 this.showSuccessText = '你已成功提交檢查結果!'
async handleSubmit() { await this.handleSubmitReport() // 1 await this.handleSubmitEdit() // 2 this.showSuccess = true // 3 this.showSuccessText = '你已成功提交檢查結果!'
在validate校驗函數內,使用async異步函數 async handleLogin() { this.$refs.form.validate(async (valid) = { if (valid) { // 獲取公鑰 await this.getEncrypte() } })