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

273
Visualizações
"getWatchLength" is not defined on the instance but referenced during render. Make sure to declare reactive data vue js properties in the data option

I've a vuex store which stores the state of the length of watched products, I get the length of product in my store but each time I try to {{getWatchlength}} in my code i get "getWatchlength" not defined

This the error I get in my console https://imageshack.com/i/pmlnoX9nj

This my vuex store https://imageshack.com/i/pmP87O5Ij I'm getting the length in my store

This my html code

<template>
  <div id="app">
    {{ getWatchLength }}
    <router-view></router-view>
  </div>
</template>

My script tag

<script>
import { mapActions } from "vuex";
import { mapGetters } from "vuex";
export default {
  name: "app",
  data() {
    return {
      categoryID: null,
      categories: [],
      products: [],
      show: null
    };
  },
  computed: {
    ...mapGetters( ["getWatchLength"], ["isLoggedIn"])
  }
};
</script>

Please, I don't know what I'm doing wrong

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try like following:

import { mapGetters, mapActions } from 'vuex';

computed: {
  ...mapGetters(["getWatchLength", "isLoggedIn"])
}
about 4 years ago · Juan Pablo Isaza Relatório
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