Is there a way to parse a string that points to computed properties in Vue as code?

I hope something like this hasn’t been asked before. I have searched and can’t find an answer. I’ve created a Vue 2 app that takes props from a JSON file created with ArchieML.

I want to find out if it is possible to take a prop, that comes as a string, and run it as code? The complication comes as the string is actually a template literal that contains the names of computed properties that are calculated within the Vue component I’m passing the string into.

As an illustration, the following template literal is passed as a string as a prop to the Vue component. Please note this doesn’t get passed to the component as a template literal but as a string.

`Revenue has increased by ${ amount } compared with last year`

Then, I have the following computed property in the component:

amount() {
   return this.thisYear - this.lastYear
}

The amount value needs to be computed in the component and the text for the template literal has to come as a prop in the form of a string. Is there a way to parse the text as code so that it picks up computed properties created in the component?

I’d appreciate any help!