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.

61 lines
1.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="tw-grid tw-grid-cols-1">
  3. <input :id="input.id" :class="[validation ? '' : 'tw-border-error-default']" :type="input.type" :value="value" :maxlength="maxlength"
  4. v-model="inputVal" :placeholder="$t(`${input.placeholder}`)" />
  5. <div v-show="errorText" class="tw-text-error-default tw-text-[14px] tw-font-medium tw-leading-[18px] tw-mt-[4px]">
  6. {{ errorText }}
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import { number } from 'is_js';
  12. export default {
  13. name: "ElementInputNew",
  14. props: {
  15. input: {
  16. type: Object,
  17. },
  18. default: {
  19. type: String,
  20. },
  21. validation: {
  22. type: Boolean,
  23. },
  24. errorText: {
  25. type: String,
  26. },
  27. maxlength:{
  28. type: Number,
  29. default: 50,
  30. },
  31. },
  32. data() {
  33. return {
  34. value: this.default ? this.default : "",
  35. };
  36. },
  37. mounted() { },
  38. watch: {
  39. default: {
  40. handler: function () {
  41. this.value = this.default;
  42. },
  43. },
  44. },
  45. computed: {
  46. inputVal: {
  47. get() {
  48. return this.value;
  49. },
  50. set(val) {
  51. this.value = val;
  52. this.$emit("change", val);
  53. },
  54. },
  55. },
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. </style>