I have a string that is passed to the frontend as comeoutside
However, in HTML, it needs to be rendered conditionally.
const separateFirstFourWords = (words) => {
let newStr = `${words.substring(0, 4)} <br> ${words.substring(4, words.length)}`;
return newStr;
};
<p>{{something === true ? 'comeoutside' : separateFirstFourWords('comeoutside')}}</p>
As you can see, I want to separate the two words and add a line break between them. How can I achieve this in VUE?