Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

480
Visualizações
Vue JS bug, @click item executing an action thats in Cache On Laravel app

I am building a Vue comment section in a Laravel Blog with Vue 3, Laravel and Bootstrap.

I have this method for storing comments in the Comments Table (MySQL)

<script>
export default {
   props: ['userid', 'blogid'],
    data() {
       return {
           formData:{
               comment:'',
               user_id: this.userid,
               blog_id: this.blogid,

           }
       }
    },
    methods: {
       commentStore(){
           axios.post('comment/store', this.formData).then((response)=> {
           console.log(response.data)
       }).catch((errors) =>{
               console.log(errors)
    });
       }
    }
}

It should be executed upon clicking the commentStore item, as seen below:

<template>
<div class="row">
    <div class="col-xl-12">
        <div class="comment-form__input-box">
            <textarea name="comment" v-model="formData.comment" placeholder="Your message here" rows="2"></textarea>
        </div>
        <button type="submit" class="thm-btn comment-form__btn" @click.native="commentStore">submit
            comment</button>
    </div>
</div>

The Problem

On click, the item still executes a previous method that I deleted.

  <script>
export default {
   props: ['userid', 'blogid'],
    data() {
       return {
           formData:{
               comment:'',
               user_id: this.userid,
               blog_id: this.blogid,

           }
       }
    },
    methods: {
       commentStore(){
        alert(this.userid)
       }
    }
}

enter image description here

Question

  1. How do I clear Vue Js Cache?

  2. If it's not the Cache, why is the current method not executing?

I have Tried

  1. clearing browsers cache

  2. performing a PHP artisan optimize on CLI

No changes, Thank you for the Assit.

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda