Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
What mistake am I making when doing a getter on a state data and want to show the result in a component?

I'm pretty much new to vuejs 3 and vuex 4. I'm trying to do something as simple as a getter. Since it didn't work for me, I made a console.log to see if the result appeared in the console. What came up was this: ComputedRefImpl {dep: undefined, _dirty: true, __v_isRef: true, effect: ReactiveEffect, _setter: ƒ, …}... I think that I have to implement ref in the computed that I use to get the information from the store getter, but I don't know what to do in this case.

state: {
  
  title:'hello'
},

getters: {

title: state => state.title

},
<template>

  {{title}}

</template>



<script>

import {computed, ref} from 'vue'
import {useStore} from 'vuex'
export default {
  name: 'Lista',

  setup(){
    const store = useStore();

    const nuevaSerie = ref("");
    let title = ref("");

    /*  const borrar_todo = async (index) =>{
        store.dispatch ('lista/borrar_todo',{ 
          index
        })
      }
            
      const nueva_serie = async (nombre) =>{
        store.dispatch ('lista/nueva_serie',{
          nombre
        }) 
      }

      const colores = async (index) =>{
        await new Promise( (aceptar)=>{   
                setTimeout( ()=>{
                    aceptar()
                },100)
            })
        store.dispatch ('lista/colores', index)
      }*/



       title = computed(() => store.getters.title)
        console.log(title)

      
    let series = store.state.lista.series

    return { series, nuevaSerie, nueva_serie, borrar_todo, colores, title}
  }   
}
</script>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I finally found the error. The way to call the store getter was wrong. I clarify that 'lista' is the name of the module

<script>

let title = computed(() => $store.getters["lista/title"])

</script>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!