29 lines
685 B
JavaScript
29 lines
685 B
JavaScript
Vue.component('tt-textarea', {
|
|
props: {
|
|
label: String,
|
|
required: Boolean,
|
|
value: String,
|
|
rows: {
|
|
type: String,
|
|
default: "3",
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
currentText: this.value,
|
|
};
|
|
},
|
|
watch: {
|
|
value(newValue) {
|
|
this.currentText = newValue;
|
|
},
|
|
},
|
|
template: `
|
|
<div class="form-group">
|
|
<label :for="label">{{ label }}</label>
|
|
<textarea class="form-control" :id="label" :required="required" v-model="currentText"
|
|
@input="$emit('input', $event.target.value)" :rows="rows"></textarea>
|
|
</div>
|
|
`
|
|
});
|