当你在html中使用调用js中的方法时,会出现这行报错:

method definition shorthands are not supported by current JavaScript version

如下图所示:



解决办法:

报错的意思是:该方法定义的缺陷是不支持当前的JavaScript版本。

所有我们需要把JavaScript版本调整成ECMAScript 6 如下图所示:



第一步:在文件(F)中找到设置,点击进去。并在搜索框上搜索JavaScript。

第二步:设置JavaScript的版本为ECMAScript 6点击确定,重启webstrom。

报错:Method definition shorthands are not supported by current JavaScript version的更多相关文章

  1. IDEA Method definition shorthands are not supported by current JavaScript version

    sentinel-dashboard前端用到了AngularJS v1.4.8,在IDEA里修改js,触发js验证时有一些js文件会出现红色波浪线. 在代码行里鼠标一上去提示信息:Method def ...

  2. 【04】在webstorm里Export declarations are not supported by current JavaScript version

    [04]在webstorm里Export declarations are not supported by current JavaScript version     Export declara ...

  3. 关于React Native 报Export declarations are not supported by current JavaScript version错误的解决问题

    设置.js文件默认以jsx的语法打开 在没有进行设置的情况下,每次打开WebStorm的时候打开包含jsx语法的.js文件都会有以下提示: 当然我们点击转换后就可以了,但是每次都会提示,所以还是来一个 ...

  4. Import declarations are not supported by current JavaScript version

    原因为:不支持当前的js版本,在perference中进行设置javascript的版本即可 注意:在perference中进行更改,而不是defeaut perference,快捷键操作为:comm ...

  5. AS报错:lambda expressions are not supported at this language level

    AS报错:lambda expressions are not supported at this language level 解决方法 打开打开 File --> Project Stuct ...

  6. Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat 8.0 installation is...

    Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat ...

  7. git pull报错:There is no tracking information for the current branch

    报错: There is no tracking information for the current branch. Please specify which branch you want to ...

  8. 部署CM集群首次运行报错:Formatting the name directories of the current NameNode.

    1. 报错提示 Formatting the name directories of the current NameNode. If the name directories are not emp ...

  9. 发布后台接口报错:could not load file or assembly 'mysql.data,' version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d

    本地调试正常,但是服务器上面一直报错:could not load file or assembly 'mysql.data,' version=6.7.4.0, Culture=neutral, P ...

随机推荐

  1. 为什么 Python 的 f-string 可以连接字符串与数字?

    本文出自"Python为什么"系列,归档在 Github 上:https://github.com/chinesehuazhou/python-whydo 毫无疑问,Python ...

  2. Nginx之Location匹配规则

    概述 经过多年发展,nginx凭借其优异的性能征服了互联网界,成为了各个互联网公司架构设计中不可获取的要素.Nginx是一门大学问,但是对于Web开发者来说,最重要的是需要能捋的清楚Nginx的请求路 ...

  3. nginx判断状态脚本

    A是nginx行数 为0则启动nginx 启动失败则杀死keepalived进程

  4. Linux-基础命令学习

    Linux终端 Linux存在两种终端模拟器,一种类MAC的Gnome和一种类Win的KDE 远程连接工具: xshell,putty,crt(网工) 如果在Linux下输入tty 1 wang@DE ...

  5. Vue项目的创建、路由、及生命周期钩子

    目录 一.Vue项目搭建 1.环境搭建 2.项目的创建 3.pycharm配置并启动vue项目 4.vue项目目录结构分析 5.Vue根据配置重新构建依赖 二.Vue项目创建时发生了什么 三.项目初始 ...

  6. 【python3】 解:import导包机制

    模块和包 模块:我们定义的.py结尾的文件就是一个模块,模块中通常定义了类.方法.变量等一系列功能: 包:存放模块的文件夹,含有init.py文件,定义path属性. import语句的作用 impo ...

  7. 清晰图解深度分析HTTPS原理

    前言 很高兴遇见你~ Https现在基本已经覆盖所有的http请求了,作为一个伟大的发明,保障了我们的通信安全.在Android中对于HTTPS其实感知不多,因为这些内容都有成熟的框架帮我们完成了,例 ...

  8. 测试成长记录:python调adb无法获取设备信息bug记录

    背景介绍: 一直在负责公司Android自动化的编写工作,采用的是uiautomator2,需要获取设备id来连接设备,就是 adb devices 问题描述: 之前一直用 subprocess.ch ...

  9. 剑指 Offer 42. 连续子数组的最大和 + 动态规划

    剑指 Offer 42. 连续子数组的最大和 题目链接 状态定义: 设动态规划列表 \(dp\) ,\(dp[i]\) 代表以元素 \(4nums[i]\) 为结尾的连续子数组最大和. 为何定义最大和 ...

  10. 基于dlib+django+python 实现web端人脸打卡

    face_recognition 基于python+django+dlib实现的人脸打卡系统 开始之前 windows用户需要安装 VS2017 其他VS版本也行 linux用户需要安装c++编译器( ...