reason:
The await keyword is only valid in async function. If you use await outside the async function, you will only get a syntax error.
Modified code
this.$refs.formRef.validate(async (varlid) => {
if (!varlid) return
const result = await this.$http.post('login', this.loginForm)
console.log(result)
Read More:
- Promise. All cooperates with await to implement synchronous execution of multiple requests
- Deep understanding of async await asynchronous programming synchronization
- Ngif of module in ionic 5 + angular
- The C language qsort() function reports an error for overflow of – 2147483648 and 2147483648
- Django + jQuery get data in the form + Ajax send data
- Encapsulation of Axios and management of API interface in Vue
- C#: How to Use Httpclient to upload files with other parameters
- An error occurred when starting pyspider with Python 3.7
- Realization of breakpoint download based on DIO in flutter
- Router DIO network request: dioerror[ DioErrorType.RESPONSE ]: HTTP status error [400] or [500]
- HTTP 405 Error: Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
- Error in v-on handler (Promise/async): “[object Object]“
- Exploring the streaming call of underscore
- [C + +] C + + overload operator = must be a nonstatic member function?
- IntegrityError at ** NOT NULL constraint failed: learning_logs_topic.owner_id
- How to Use Truffle to Deploy contracts on moonbeam
- C++:error C2228: left of ‘.str’ must have class/struct/union
- Login authority verification
- Python2 PicklingError: Can‘t pickle <type ‘instancemethod‘>: attribute lookup __builtin__.instanceme
- WNetAddConnection2 – error 1219