After calculating the property shown below, it will output res
, which is a Promise object. The reason I cannot place this script inside the created()
or mounted()
hook is due to the fact that this.selectedObject
is null
at that time.
I am satisfied with the result in res
, but the issue arises when I attempt to display PromiseResult
in HTML:
<div>{{ currentDepStatus }}</div>
. Instead of displaying the content of PromiseResult, it just shows [Promise object]
. Any assistance on this matter would be greatly appreciated.
computed: {
currentDepStatus() {
let res = '';
if (!this.selectedObject) return [];
const deps = this.depCategory(this.selectedObject.id);
if (deps.length > 0) {
res = sendDepStatus(deps);
}
return res;
},