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

152
Views
TypeError no detectado: no se pueden establecer propiedades de indefinido (estableciendo 'isSubcon')

necesita ayuda aquí.

Quiero que mi cajón de navegación muestre diferentes contenidos según los tipos/roles de usuario de aquellos que iniciaron sesión.

Pero encuentro este error ("Error de tipo no detectado: no se pueden establecer propiedades de indefinido (estableciendo 'isSubcon'") y mi cajón de navegación no muestra nada.

mi template

 <v-list v-if="isSubcon"> //content of drawer if user that logged in is a "Subcon" </v-list> <v-list v-if="isWPC"> //content of drawer if user that logged in is a "WPC" </v-list> <v-list v-if="isBWG"> //content of drawer if user that logged in is a "BWG" </v-list>

mi script

 data: () => ({ isSubcon: false, isWPC: false, isBWG: false, }), // I think below is where the problem occurs. created() { firebase .auth() .onAuthStateChanged((userAuth) => { if (userAuth) { firebase .auth() .currentUser.getIdTokenResult() .then(function ({ claims, }) { if (claims.customer) { this.isSubcon = true; //HERE WHERE THE PROBLEM OCCURS (i think) } else if (claims.admin) { this.isWPC =true; //THIS ALSO } else if (claims.subscriber) { this.isBWG = true; //AND THIS ALSO } } ) } }); },

Estoy usando Firebase Custom Claims para iniciar sesión y Nuxt (modo: SPA) con Vuetify para la interfaz de usuario. Entonces, ¿cómo puedo eliminar el error para poder mostrar el contenido en mi cajón de navegación?

Gracias de antemano :))

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

0

this depende siempre del alcance/objeto llamado y ambos data: () => ({ ... }) y created() parecen ser propiedades de otro objeto. Si lo invocas con:

 myObject.created();

entonces la solución a continuación debería hacerlo.

 created() { let that = this; firebase ... .then(function ({ claims }) { if (claims.customer) { that.isSubcon = true; //HERE WHERE THE PROBLEM OCCURS (i think) } else if (claims.admin) { that.isWPC =true; //THIS ALSO } else if (claims.subscriber) { that.isBWG = true; //AND THIS ALSO } }) }
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!