vue项目运行... 运算符没能被识别

在vue根目录新建.babelrc  文件(自定义文件,非js)

cnpm install --save-dev babel-plugin-transform-object-rest-spread

然后plugins中配置好

{
  "presets": [
    [
          "env",
          {
            "modules": false,
            "targets": {
              "browsers": [
                "> 1%",
                "last 2 versions",
                "not ie <= 8"
              ]
            }
          }
        ],
    "stage-2",
	
  ],
 "presets": [
   ["es2015", { "modules": false }]
  ],
  "plugins": [
	  "transform-object-rest-spread",
  ]
}

OK

你可能感兴趣的:(vue项目运行... 运算符没能被识别)