Oops! Looks like the maximum call stack size has been exceeded, resulting in a RangeError. Additionally, a warning from Vue has been triggered due to an error in the v-on handler related to

I am in the process of developing a student management system that provides me with a comprehensive list of students, their individual details, and a feature within the "StudentDetails" component that enables me to navigate to another component. Below are the relevant code snippets:

Vue Router :

import Vue from "vue";
import VueRouter from "vue-router";
import StudentList from "@/components/ListaAlunos.vue";
import HomeComp from "@/views/HomeComp.vue";
import AdicionarNota from "@/views/AdicionarNota.vue";
import DetalhesEstudante from "@/components/StudentCard.vue";
import AdicionarAluno from "@/views/StudentRegister.vue";
Vue.use(VueRouter);

export default new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/",
      name: "home",
      component: HomeComp,
    },
    {
      path: "/student-list",
      name: "studentList",
      component: StudentList,
    },
    {
      path: "/estudantes/:id",
      name: "detalhesEstudante",
      component: DetalhesEstudante,
    },
    {
      path: "/detalhes-estudante-nota/:id",
      name: "adicionarNota",
      component:...

Student List Component :

<template>
  <div>
    <ul>
      <li v-for="estudante in estudantes" :key="estudante.id">
        <q-btn square color="grey"
          ><router-link
            :to="{ name: 'detalhesEstudante', params: { id: estudante.id } }"
            >{{ estudante.nome }}</router-link
          >
        </q-btn>
      </li>
    </ul>
  </div>
</template>

<script>
import { mapGetters, mapState } from "vuex";

export default {
  computed: {
    ...mapGetters(["estudantes"]),
    ...mapState(["estudantes"]),
  },
  async created() {
    await this.$store.dispatch...

Student Card ( Student Details ) Component :

<template>
  <div>
    <div v-if="estudanteAtual">
      <h1>{{ estudanteAtual.nome }}</h1>
      <p>Média: {{ media }}</p>
      <p>Maior Nota: {{ maiorNota }}</p>
      <p>Menor Nota: {{ menorNota }}</p>
      <p>Quantidade de Provas: {{ quantidadeProvas }}</p>
...

AdicionarNota (addMark component) :

<template>
  <div>
    <h1>Adicionar Nota</h1>
    <form @submit.prevent="adicionarNota">
      <label>
        Nota:
        <input type="number" v-model="nota" required />
      </label>
      <button type="submit">Adicionar</button>
    </form>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  props: {
    id: {
      type: [Number, String],
      required: true,
...

Axios Service :

import axios from "axios";

const API_URL = "http://localhost:8080/estudantes";

class EstudanteService {
  // Criar um estudante
...

Vuex :

import EstudanteService from "../services/StudentService.js";
import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
...

Could someone assist me in resolving this stack error and building the AddStudent Component?

Answer №1

It seems like there might be an issue with your AdicionarNota component. The problem lies in having a method named adicionarNota that calls a vuex action with the same name. To resolve this, consider renaming your method:

methods: {
    ...mapActions(["adicionarNota"]),
    addNota() {
      this.adicionarNota({
        id: this.id,
        nota: this.nota,
      });
    },
  },

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

Setting the row ID value after performing form editing in free jqGrid

In the table, there is a primary key with 3 columns (Grupp, Kuu, Toode), and the server returns an Id created from those columns. When the primary key column is changed in form editing, the server sends back a new row id. However, Free jqgrid does not se ...

Encountering trouble with displaying data in Express and Mongoose

Struggling to comprehend how to define and utilize an API in Express, while using Mongoose to connect with MongoDB. Successfully saving objects from input on the front end, but getting lost when it comes to retrieving and displaying the saved data. Take a ...

Tooltips experience issues when interacting with elements that do not utilize the :active state

$(function () { $('[data-toggle="tooltip"]').tooltip() }) <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" ...

JQuery: Issue with closing modal on certain popups

I have configured a popup that is associated with 6 different products. While it functions correctly for the first product, it does not seem to work properly for the rest. <script> //var modal = document.getElementById("m ...

Is there a reason why the slide up feature is not working when I include the ul tag?

I need help with a jQuery code that will pull up/slide up an Html "p" tag when my page finishes loading. This snippet of jQuery code seems to be working fine: $(function () { $('.graybgc').slideUp(0); }); This is the HTML structure: <p ...

"Enhance your Angular configuration with the powerful ngBootbox plugin

Is there a way to permanently change the locale of ngBootbox? I tried adding an extra angular configuration: var app = angular.module('some_module', ['highcharts-ng', 'ui.router', 'oc.lazyLoad', 'ui.selec ...

Transform a dropdown menu into an inverted footer

I stumbled upon a unique dropdown menu design that I want to tweak and reverse, making it an innovative "dropup" menu that opens from the bottom to the top. Currently, this is what I have: HTML <div class="get-started"> <a href="#" id="get-s ...

Enable automatic playback of HTML5 video with the sound on

I want to add an autoplay video with sound on my website, but I'm running into issues with newer browsers like Chrome, Mozilla, and Safari blocking autoplay if the video doesn't have a 'muted' attribute. Is there a clever HTML or Javas ...

Exploring the dichotomy between controlled and uncontrolled elements within React. The _class attribute causing unexpected changes in an un

I created a custom Checkbox component that is essentially a styled checkbox with a 'fake element' acting as the original one. Custom Checkbox Component import React, {Component} from 'react'; import FormGroup from 'react-bootstra ...

Adjust the size of the scene to make it smaller and position the canvas within a div

My current project involves Three.js and can be accessed here in its entirety. The particles in the project have a lot of vertical space around them that is unoccupied. I am trying to find a way to reduce this space or put the project inside a div. I trie ...

Is it possible to incorporate a PHP line within a Handlebars context array?

I'm currently utilizing handlebars along with a handlebars register helper to iterate through an array that I've included in my context. The result is then displayed as an unordered list (ul). However, I'm facing an issue when attempting to ...

Using the v-for directive to create sequential lists

I am struggling to display pairs of data from an object based on category using nested v-for loops. The object, categoryArray, contains entries such as {stage 1, red}, {stage 1, blue}, {stage 2, orange}, {stage 3, brown}, {stage 2, green. My desired displ ...

Utilizing JavaScript to create multiple HTML tables from JSON data

Is it necessary to create separate tables in HTML for each set of JSON data when all tables have the same number of columns (2 columns)? I am looking to minimize the JavaScript function that displays the table with the current JSON data. Can I use one tabl ...

When trying to assign the result of res.send() to another variable in NodeJS Express, it does

My current Express version is 3.4.4 and I encountered an issue when trying to implement the following code: var cb = res.send; cb(result); This resulted in an error message: ...\node_modules\express\lib\response.js:84 var HEAD ...

Vue component, store data for future use

I need to find a way to store data in a vue component for future use. Data function, example 1 data: function () { return { username: '', phoneNumber: '', } } Saving method var x = JSON.stringify(th ...

Vue-CLI encounters a hiccup while attempting to fetch an image from the assets directory

Currently working with vue-cli 3 and I've implemented this style: .login-page { ... background: url("~@/assets/login-bg.jpg") no-repeat; background-size: cover; background-position: center; ... } However, upon running yarn serve, an error ...

Creating a Node.JS application, developing an Express JS API, and handling errors

I am facing challenges while developing a REST API in Express.js and I am seeking assistance. Below is my Express.js code: router.get( '/apps/download/:downloadId', function ( req, res, next ) { const opts = Object.assign( {downloadId: re ...

Adding individual buttons at the bottom of each data row using Jquery: A step-by-step guide

Currently, I am receiving data from a backend using an AJAX GET method and displaying it in a list in HTML. However, I am facing some issues with including buttons within the list and making them functional by utilizing delegate and other methods. I would ...

displayEvent not functioning properly within fullcalendar

I'm attempting to add an event to FullCalendar.io using a JavaScript function. I've tried two methods. Triggering the function at the end of the page or by clicking. No error is displayed, but the event isn't showing up on my calendar. & ...

Enhance the numerical value displayed in jQuery UI tooltips

I have folders with tooltips displaying text like '0 entries' or '5 entries' and so on. I am looking for a way to dynamically update this tooltip number every time an item is added to the folder. The initial count may not always start a ...