本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

2024-11(8)

error Parsing error: Unexpected reserved word ‘await‘.

发布于2021-10-05 19:25     阅读(840)     评论(0)     点赞(29)     收藏(3)


在这里插入图片描述

原因:

await 关键字仅在 async function 中有效。如果在 async function 函数体外使用 await ,你只会得到一个语法错误。

修改后的代码

 this.$refs.formRef.validate(async (varlid) => {
        if (!varlid) return
        const result = await this.$http.post('login', this.loginForm)
        console.log(result)

原文链接:https://blog.csdn.net/qq_45104740/article/details/120589849




所属网站分类: 技术文章 > 博客

作者:哦八戒八戒

链接:http://www.qianduanheidong.com/blog/article/197916/f8b833ea627bd73af3eb/

来源:前端黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

29 0
收藏该文
已收藏

评论内容:(最多支持255个字符)