[Vuejs]-Display text as entered in the form with new lines in VueJS

0👍

Change the content of the profile inside computed replacing the \n with <br>

computed:{
  profile:function(){
    return this.user.profile.replace(/\n/g, '<br />');
  }
}

and in template you can use it as html content like this

<div id="user-profile" v-html="profile"></div>

Leave a comment