简体   繁体   English

我的 Vue.js 项目中有一个 ESlint 错误,为什么我不能修复它

[英]I have an ESlint error in my Vue.js project, why can't I fix it

A few months ago I came across this error in my vue.js project line numbers 22, 23 and 24 relate to lines 45, 46 and 47 in my code block at the bottom几个月前,我在我的 vue.js 项目中遇到了这个错误,第 22、23 和 24 行与底部代码块中的第 45、46 和 47 行相关

{
    "resource": "/C:/Users/Demo User/Documents/vue/mynewwebsite/src/App.vue",
    "owner": "eslint",
    "severity": 8,
    "message": "Parsing error: Unexpected token, expected \",\"\n\n  22 |   }\n  23 | }\n> 24 |\n     | ^",
    "source": "eslint",
    "startLineNumber": 47,
    "startColumn": 1,
    "endLineNumber": 47,
    "endColumn": 1
} 

Since then I have tried to find solutions on SO and google and I asked a friend.从那以后,我试图在 SO 和 google 上找到解决方案,并问了一个朋友。 I thought it was just a comma in the wrong place and tried adding and removing commas in appropriate places but that didn't help (edit: I had missed a curly brace, duh)我认为这只是一个错误位置的逗号,并尝试在适当的位置添加和删除逗号,但这没有帮助(编辑:我错过了一个大括号,废话)

Here is my code from the script tag in App.vue这是我在App.vue的 script 标签中的App.vue

25 <script>
26 import Modal from './components/Modal.vue';
27 export default {
28  name: 'App',
29  components: { Modal, },
30  data() {
31    return {
32      title: 'my new website',
33      header: 'Modal Header',
34      text: 'modal content',
35      showModal: false,
36      showModalTwo: false
37    }
38  },
39  methods: {
40    toggleModal() {
41      this.showModal = !this.showModal;
42    },
43    toggleModalTwo() {
44      this.showModalTwo = !this.showModalTwo;
45  }
46 }
47 </script>

我在toggleModalTwo缺少一个 '}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能通过 Vue.js 访问我的对象中动态插入的属性? - Why can't I access my dynamically inserted attribute in my Object via Vue.js? 我的Vue.js代码中有很多重复项,该如何解决? - I have a lot of repetition in my Vue.js code, how could I fix that? 重新加载vue.js单个应用程序时出现错误,请参见vue.js代码 - i have error see vue.js code when reload vue.js single application 如何在我的 Vue.js 项目中以横向模式打印 html 页面 - How can I print html page in Landscape mode in my Vue.js project 如何在Laravel项目中设置Vue.js? - How can I set up Vue.js in my Laravel Project ? 为什么当我使用Vue.js时搜索不起作用? - Why doesn't my search work when I use Vue.js? 为什么我的编辑页面在 Laravel 中不起作用? 我用过 vue.js - Why my edit page didn't work in Laravel? I used vue.js 当我在 vue.js 项目中修改节点模块时,我是否必须重新编译某些内容才能使其工作? 变化没有反映 - When I modify a node module in my vue.js project, do I have to recompile something to get it to work? The change is not reflected 我无法从vue.js组件中的方法访问数据值? - i can't access data values from methods in my vue.js component? 如何将此组件集成到我的 vue.js 中? - How can I integrate this component in my vue.js?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM