✘ http://eslint.org/docs/rules/no-trailing-spaces Trailing spaces not allowed
src\components\NavMenu.vue:2:1
^
✘ http://eslint.org/docs/rules/space-before-function-paren Missing space before function parentheses
src\components\NavMenu.vue:83:17
handleOpen(key, keyPath) {
^
✘ http://eslint.org/docs/rules/semi Extra semicolon
src\components\NavMenu.vue:84:34
console.log(key, keyPath);
^
✘ http://eslint.org/docs/rules/space-before-function-paren Missing space before function parentheses
src\components\NavMenu.vue:86:18
handleClose(key, keyPath) {
^
✘ http://eslint.org/docs/rules/semi Extra semicolon
src\components\NavMenu.vue:87:34
console.log(key, keyPath);
^
✘ http://eslint.org/docs/rules/eol-last Newline required at end of file but not found
src\components\NavMenu.vue:91:10
</script>
^
问题原因是因为不符合EsLint的语法规则
解决方案如下图
然后 npm run build
ESLint最初是由Nicholas C. Zakas 于2013年6月创建的开源项目。它的目标是提供一个插件化的javascript代码检测工具
我这里简单粗暴的注释了,但想要统一风格,可以研究一下ESLint,ESLint是可以配置的
http://eslint.cn/