When using my VueJS form, I encounter an issue where line breaks in my textarea content are ignored when rendering the email format on the Java backend side. How can I ensure that my line breaks are preserved when sending the content from the front end to the back end?
<template>
<div>
<form @submit.prevent="create">
<label for="comment-title"></label>
<input
type="textarea"
id="comment-title"
label="Message"
placeholder="Enter your message"
v-model="comment"
/>
<button type="submit">create</button>
</form>
</div>
</template>
<script>
export default {
data() {
return {
comment: ''
};
},
methods: {
create() {
const msg = {
createdAt: new Date(),
comment: this.comment
};
this.$store.dispatch("createMsg", msg)
this.comment = ''
}
}
};
</script>