Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

245
Vistas
In Vue3 changing root state stopped working

My mutations which changes root state stopped working

 SET_STATE(state, payload) {
    state = { ...state, ...payload };
 }

But changing inner value is working

SET_INNER_STATE(state, payload) {
   state.inner = payload;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This state = ... changes state local variable (parameter), it cannot affect anything that happens outside this function.

{ ...state, ...payload } shouldn't be done in Vue because it doesn't force immutable state the same way as React.

Initial state should be generally set on store initialization. If it should occur later for some reason, it should be merged to existing state object. Shallow merge can be:

Object.assign(state, payload);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda