In my Vue.js method, I am using a template literal:
methodNameDisplay(m) {
let nameToDisplay = '';
if (m.friendlyName === m.methodName) {
nameToDisplay = m.friendlyName;
} else {
nameToDisplay = `${m.friendlyName} - ${m.methodName}`;
}
return nameToDisplay;
}
This method is used to retrieve the title value as shown below:
<MethodRepeaterTitle :title="showMName ? methodNameDisplay(m) :m.friendlyName" />
I need to style the text after the hyphen in the template literal. How can this be achieved?
I attempted adding a tag to the template literal but it displayed as plain text since Vue did not recognize the tag.