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

149
Views
No se puede acceder a los captadores en la tienda para Vue cuando está en una plantilla porque "no es una función"

Soy nuevo en vue y vuex y también estoy usando Nuxt. Quiero usar una función en mi plantilla que busca algunos datos que obtuve de una API (en vuex). No puedo entender por qué siempre obtengo

 state.allHandhelds.values.findIndex is not a function

Mi plantilla es así:

 <div>{{ handheldID("Form Factor") }}</div>

Y en mi computado llamo a la función así:

 computed: { ...mapGetters(["allHandhelds"]), handheldID(merkmal) { return this.$store.getters.indexFinder(merkmal); }, },

En vuex lo tengo definido como getter:

 export const getters = { indexFinder(state, merkmal) { return state.allHandhelds.values.findIndex( (el) => el === merkmal ); /* Index des Merkmals finden */ }, };

¿Alguna idea de dónde me estoy equivocando con eso?

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

0

Tienes que usar el estilo de acceso al método como:

 export const getters = { indexFinder: (state) => (merkmal) => { return state.allHandhelds.values.findIndex( (el) => el === merkmal ); } };

o con sintaxis:

 export const getters = { indexFinder(state) { return (merkmal)=> { return state.allHandhelds.values.findIndex( (el) => el === merkmal ); /* Index des Merkmals finden */ } }, };
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!