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

107
Vistas
Props object not working on mounted method

i have preFile variable whitch is coming from props and i am changing on mounted method but when i try to use preFile to pass fileProcess method, for is not not working but if i call fileProcess from enother method everyting working fine. I cannot find what is problem why my method is not working when i call on mounted

enter image description here

on mounted :

 mounted() {
    
    let file = []
    let index = 0
    Object.entries(this.preData).forEach(entry => {
        let FileURL = this.asset + '/' + this.id + '/' + entry[1]['name']
        this.GetFileObjectFromURL(FileURL, function (fileObject) {
            file[index] = fileObject
            index++
        }, entry[1]['name'])
    });
    this.preFile = file
    console.log(this.preFile)
    if (this.gallery){
        this.fileProcess(this.preFile)
    }else{
        this.gallery = true
        this.fileProcess(this.preFile)
    }
},

diffetrent method (i am calling this method with click):

 asd(){
        console.log(this.preFile)
        if (this.gallery){
            this.fileProcess(this.preFile)
        }else{
            this.gallery = true
            this.fileProcess(this.preFile)
        }
    },

and fileProcess method:

fileProcess(files){
        for (let key in files){
            
        }
    },
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

i found solition. The promlem is probably asynchronous operations. @aside as mentioned here https://stackoverflow.com/a/58610995/4201269 but i use different method.

i used settimeout for it :

 setTimeout(function() {
    if (this.gallery){
        this.fileProcess(this.images)
    }else{
        this.gallery = true
        this.fileProcess(this.images)
    }
}.bind(this), 1000);
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