You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
908 B

2 years ago
  1. <template>
  2. <div class="tw-flex tw-flex-col">
  3. <label class="tw-mb-[10px]" :for="input.id"><span>{{ $t(input.label)
  4. }}<span v-if="input.required" class="required">*</span></span></label>
  5. <textarea :id="input.id" :class="[validation ? '' : 'tw-border-error-default']" :placeholder="input.placeholder"
  6. v-model="inputVal" rows="3"></textarea>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: "ElementTextarea",
  12. props: {
  13. input: {
  14. type: Object,
  15. },
  16. default: {
  17. type: String,
  18. },
  19. validation: {
  20. type: Boolean,
  21. },
  22. },
  23. data() {
  24. return {
  25. value: "",
  26. };
  27. },
  28. mounted() {
  29. this.value = this.default;
  30. },
  31. computed: {
  32. inputVal: {
  33. get() {
  34. return this.value;
  35. },
  36. set(val) {
  37. this.value = val;
  38. this.$emit("change", val);
  39. },
  40. },
  41. },
  42. };
  43. </script>
  44. <style lang="scss" scoped>
  45. </style>