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

205
Views
Cómo confirmar el formulario de muación de vuex dentro del mismo archivo (en Nuxt)

Seguí este tutorial para configurar una tienda de autenticación de firebase en vuex ( https://www.youtube.com/watch?v=n9cERWIRgMw&list=PL4cUxeGkcC9jveNu1TI0P62Dn9Me1j9tG&index=10 )

Sin embargo, estoy usando Nuxt, lo que hace que el último paso se rompa.

Mi archivo:

 import { auth } from "~/plugins/firebase.js"; import { createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut, onAuthStateChanged, } from "firebase/auth"; export const state = () => ({ user: null, authIsReady: false, }); export const mutations = { setUser(state, payload) { state.user = payload; console.log("user state changed:", state.user); }, setAuthIsReady(state, payload) { state.authIsReady = payload; }, }; export const actions = { async signup(context, { email, password }) { console.log("signup action"); const res = await createUserWithEmailAndPassword(auth, email, password); if (res) { context.commit("setUser", res.user); } else { throw new Error("could not complete signup"); } }, async login(context, { email, password }) { console.log("login action"); const res = await signInWithEmailAndPassword(auth, email, password); if (res) { context.commit("setUser", res.user); } else { throw new Error("could not complete login"); } }, async logout(context) { console.log("logout action"); await signOut(auth); context.commit("setUser", null); }, }; const unsub = onAuthStateChanged(auth, (user) => { store.commit("setAuthIsReady", true); store.commit("setUser", user); unsub(); });

Error:

 Uncaught (in promise) ReferenceError: store is not defined at eval (index.js?9101:56:1) at eval (index-6de4cbb9.js?3d11:2453:1)

¿Cómo cometo una mutación desde aquí? Probé muchas cosas, como this.$store, $store, etc.

about 4 years ago · Juan Pablo Isaza
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!