I'm trying to display a result from an async method in the Vue/Ionic Template. I successfully retrieve the value from the local storage and output it using console.log
setup() {
import {Plugins} from "@capacitor/core";
const {Storage}=Plugins;
const getEmail= async()=>{
const emailv=await Storage.get({key: "email"});
console.log(emailv.value);
return emailv.value;
};
}
I also tried this
setup() {
import {Plugins} from "@capacitor/core";
const {Storage}=Plugins;
const emailv= async()=>{
const {value}=await Storage.get({key: "email"});
console.log(value);
return value;
};
}
And that's how I call it on my template:
<ion-note>{{emailv()}}</ion-note>
The problem is that, although it's being successfully displayed on the console, it doesn't seem to work on the template. It just shows me "[object Promise]". I have tried looking for some solutions and, from what I understood (please correct me if I'm wrong as I'm not sure how async-await works.), once I retrieve the variable, I should be able to use it everywhere.
So my question is:
Is there any way for me to "get" this variable and display it in the template?