Reputation: 23
Hi i wanna try to formate text to break line after ***
this is only part of the script i think the problem is on computed part maybe i wrote something wrong i have already tried this:
<div v-html="post.case_history"></div>
and this:
computed() {
post.case_history.replace('***', '<br>')
}
I got this error
Invalid value for option "computed": expected an Object, but got Function.
Upvotes: 0
Views: 118
Reputation: 23
Thanks lot i have found the solution:
<div v-html="history(post)"></div>
methods: {
history(post) {
return post.case_history.replace('***', '<br>') . replace(/\*\*\*/g, '<br>').replace(/------------------------------/g, '<br>');
}
}
Upvotes: 0