Here is the code I have written:
const keyToDisplayMessage = 'REGULAR_HOME';
const cf = format(
{
accountName: this.accountName,
},
this.pageData.sucessMessages.keyToDisplayMessage,
this.$route.name
);
return cf;
The issue I am facing is that keyToDisplayMessage
does not get replaced by REGULAR_HOME
. However, if I directly use it like
this.pageData.sucessMessages.REGULAR_HOME
then it works perfectly fine.
I am wondering how can I access keyToDisplayMessage
inside the format function?