当你在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. java数据类型(基础篇)

    public class note02 { public static void main(String[] args) { //八大基本数据类型 //1.整数 byte num1 = 1; shor ...

  2. python 相对路径和绝对路径的区别

    一,Python中获得当前目录和上级目录 获取当前文件的路径: from os import path d = path.dirname(__file__) #返回当前文件所在的目录 # __file ...

  3. 微信小程序:快速生成less文件类嵌套的结构

    全部选中标签结构,按住ctrl+shift+p,选中插件Generate CSS tree(提前安装CSS Tree),先删除undefined,将img替换成image,删除标签名view. 完整的 ...

  4. virtualbox-centos扩容

    virtualbox-centos扩容 版本信息 virtualbox:版本 6.1.4 r136177 (Qt5.6.2) centos:CentOS Linux release 7.7.1908 ...

  5. js的基本数据类型与引用数据类型

    基本数据类型与引用数据类型 基本数据类型有五种 /* 基本数据类型有: - String - Number - Boolean - Null ** typeof null === 'object' 这 ...

  6. 后端程序员之路 40、Pthreads

    POSIX线程(POSIX threads),简称Pthreads,是线程的POSIX标准.线程这个东西在操作系统原理里讲得比较清楚了,再加上对windows那一套进程线程的东西比较清楚,所以这里还是 ...

  7. Spring-05 使用注解开发

    Spring-05 使用注解开发 使用注解开发 1.项目准备 在spring4之后,想要使用注解形式,必须得要引入aop的包5 <!-- https://mvnrepository.com/ar ...

  8. 破解 Android 上 airpods 连接软件的pro版

    0x00 起因 起因是在Android上用了一段时间的AndPods觉得不太好用之后,换到了另一个Play商店推荐的App.动画.连接和电量提示都用的很满意,就是每次连接的弹窗和APP里面都有广告,就 ...

  9. WS1008网络损伤测试仪

    WS1008网络损伤测试仪具备高性能的网络损伤仿真功能.冗余链路测试功能和线速流量生成功能,提供了综合性的网络系统测试方案,可充分测试.验证网络系统的抗损伤能力.链路切换能力及数据转发能力.为高可靠性 ...

  10. vue项目安装sass步骤等遇到的问题

    1.安装sass依赖包 npm install --save-dev sass-loader 注释(可能会出现问题:sass-loader版本过高导致,可以将其package.json中的版本改为7. ...