[英]Vue.js + eslint. Error Parsing error: Unexpected token @
I'm doing project Django Rest Framework + Vue.js I've got a problem with eslint我正在做项目 Django Rest Framework + Vue.js 我有一个关于 eslint 的问题
error Parsing error: Unexpected token错误解析错误:意外的令牌
5 | <b-container>
6 | <b-row class="question-row">
> 7 | <b-form @submit="onSubmit" @reset="onReset">
| ^
8 | <b-form-group id="input-group"
9 | :label="getQuestion(1)"
10 | label-for="input-1">
here's my .eslintrc.json file这是我的 .eslintrc.json 文件
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:vue/essential",
"plugin:vue/base"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"plugins": [
"vue"
],
"rules": {
"max-len": ["error", {"code": 121}],
"semi": ["error","always"],
"no-console": 0
}
}
and do I need babel.config.json?我需要 babel.config.json 吗? It was added to my project after initializing Vue project.它是在初始化 Vue 项目后添加到我的项目中的。 Here's my code这是我的代码
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
};
尝试将@submit 更改为 v-on:submit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.