I'm encountering an issue with ESlint in my Vue.js project that I just can't seem to resolve

A couple of months back, I encountered this issue within my vue.js project. The error seems to be originating from lines 22, 23, and 24, which correspond to lines 45, 46, and 47 in the code block below.

{
    "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
} 

Ever since then, I've been scouring Stack Overflow, Google, and seeking advice from a friend to resolve this issue. Initially, I suspected it was a misplaced comma and attempted to add or remove commas at different locations, only to find out later that I had missed a curly brace (facepalm).

Below is the snippet of code from the script tag in 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>

Answer №1

In my code for the function toggleModalTwo, I had forgotten to include a closing curly brace '}'.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Hello, I'm looking for assistance with this ReactJS code. Is there anyone who can help me

I am not receiving any output and also not encountering any errors, how can I resolve this issue? import React from 'react' function Array() { function myConcat() { const Villain = ["Harley Quinn", "Brainiac", "Deathstroke"]; cons ...

"Simultaneously creating a Firebase user account and populating the database with user

My goal is to store new user information in my database using their unique user UID when they sign up through Firebase. Currently, my code is functioning properly, however, I am facing an issue where the name (which should be the created user UID) appears ...

Remove all $.ajax requests from content that has been loaded using $.ajax in jQuery

I'm currently working on a page where users can click a link to load content using $.ajax into a designated container div. However, I've encountered an issue with multiple clicks causing an increase in the number of $.ajax requests and resulting ...

Generating HTML output using a JavaScript file

Is it possible to return HTML Code from a .js file? Here is the code snippet: HTML: ... .. . <script id="message-response-template" type="text/x-handlebars-template"> <div class="sender-message-line table-content v ...

What is the best way to append characters to the end of a value if it is already present?

I have a functionality in place where clicking the post button inserts a random value into the database. It also displays an error if the same value already exists in the database, which is working fine. Now, I want to further enhance this by adding 2/3 c ...

Iterating through each data attribute using a jQuery each loop

I've encountered an issue with resetting data attributes post-animation and have been attempting to implement a method found on answer 2 of a related thread. I'm a bit stuck on what might be causing the problem. It should theoretically be possib ...

Refresh your HTML by reloading the JavaScript source

In my Ubuntu setup, I've been using chart.js to generate a graph displaying the values from a pressure sensor on an HTML document. Most of the project is complete, but I've encountered a challenge for which I haven't found a satisfactory sol ...

Implementing a JSON query with an onkeyup event listener

My main objective with this code is to trigger a json query request by using a textfield to specify the location. It's essentially a quick search feature that searches for specific content on a different website. For example, if I input www.calsolum/ ...

"Using JavaScript to toggle a radio button and display specific form fields according to the selected

Currently, I am attempting to show specific fields based on the selected radio button, and it seems like I am close to the solution. However, despite my efforts, the functionality is not working as expected and no errors are being displayed. I have define ...

Issue encountered with Jquery Carousel: "Unable to access property 'safari' as it is undefined"

Having recently set up a duplicate of my website in a development directory, I've come across an issue with the jQuery Carousel not working properly. An error message now pops up saying: Uncaught TypeError: Cannot read property 'safari' of ...

Extract the text and value from an asp.net treeview by utilizing jQuery or JavaScript

On my website, I am using a TreeView controller. I have disabled node selection by setting SelectAction = TreeNodeSelectAction.None as I have the checkbox option enabled. However, this causes an error when trying to access the .href property of the node. T ...

What could be causing the React.js axios data to display on the console but not on the screen?

I am currently working on a React Axios Project using data from . The characters data includes another API link, so I implemented an Axios loop to display the names of the characters. While I can see the characters' names in the console, they are not ...

Avoiding model updates when cancelling in angular-xeditable

I am utilizing angular-xeditable. When changing the value of "editable-text" and pressing the Cancel button, the "editable-text" value should revert back to its previous one. In other words, "editable-text" keeps updating the model even if the Cancel butto ...

Generating a sequential array of dates and times in Angular

Currently, I am working on implementing a feature that will allow users to see the available visit times between two dates they select, specifically from 8:00 to 17:00 every day. For instance: If a user selects 1 Sep to 4 Sep, the system should return [1. ...

Tips for creating a stylish web component using vite and vue 3

After successfully creating a Vue web component and integrating it into other pages, I encountered an issue with including a UI framework. It appears that the web component is contained within shadowDOM, making it challenging to import CSS using a style ta ...

Trigger notifications exclusively for specific hyperlink texts that are selected

I'm facing an issue where I need to notify the user when a specific link text for a hyperlink is clicked. The code provided here showcases the problem I am currently encountering. At the moment, the alert triggers whenever any link text is clicked, ra ...

Retrieving the Image of an Amazon Product using ASIN

My goal is to locate the image URLs for Amazon products using only their ASIN. For instance: This link pertains to a product with the ASIN B07NVVQL66 in the United States. Clicking on it will display an image of the product http://images.amazon.com/imag ...

Manipulate state in parent component from child component using onClick function with React hooks

Hello, I am facing a challenge trying to store data from a modal (child function) within the main (parent) function. Depending on which button is clicked, the modal loads specific HTML content (all buttons perform the same action). export default function ...

Discovering the power of Next.js Dynamic Import for handling multiple exportsI hope this

When it comes to dynamic imports, Next.js suggests using the following syntax: const DynamicComponent = dynamic(() => import('../components/hello')) However, I prefer to import all exports from a file like this: import * as SectionComponents ...

Reset checkboxes in Material UI data grid

Currently, I am immersed in a React Js project that involves various tabs, each containing a unique data grid table with rows featuring checkboxes. Issue: Whenever I select a row from Table 1 and navigate to Tab 2 before returning to Tab 1, the checkboxes ...