0👍
✅
One alternative would be to have a simple property in the data
object and update it in your function, as follows:
data: {
//....
photoUrl: null,
//....
}
//...
onFileChanged: async function(e) {
this.image = e.target.files[0];
if (this.image) {
try {
this.loading = true;
const url = await saveImage(this.image, this.uploadProgress);
this.photoUrl = url; // <-------
await auth.currentUser.updateProfile({
photoURL: url
});
await auth.currentUser.reload();
} catch (error) {
//...
} finally {
//...
}
}
}
Source:stackexchange.com