skillbox/client/src/components/content-forms/TextForm.vue

33 lines
662 B
Vue

<template>
<div class="text-form">
<textarea
:value="text"
class="text-form__input skillbox-textarea"
data-cy="text-form-input"
placeholder="Text erfassen..."
@input="$emit('text-change-value', $event.target.value, index)"/>
</div>
</template>
<script>
export default {
props: ['value', 'index'],
computed: {
text() {
return this.value.text ? this.value.text.replace(/<br(\/)?>/, '\n').replace(/(<([^>]+)>)/ig, '') : '';
}
}
}
</script>
<style scoped lang="scss">
@import "@/styles/_variables.scss";
.text-form {
&__input {
width: $modal-input-width;
}
}
</style>