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.

33 lines
728 B

  1. <template>
  2. <v-text-field
  3. v-bind="$attrs"
  4. :value="value"
  5. :rules="projectNameRules"
  6. :label="$t('overview.projectName')"
  7. required
  8. @input="$emit('input', $event)"
  9. />
  10. </template>
  11. <script lang="ts">
  12. import Vue from 'vue'
  13. import { validateMinLength, validateNameMaxLength } from '~/domain/models/project/project'
  14. export default Vue.extend({
  15. props: {
  16. value: {
  17. type: String,
  18. default: '',
  19. required: true
  20. }
  21. },
  22. data() {
  23. return {
  24. projectNameRules: [
  25. (text: string) => validateMinLength(text) || this.$t('rules.projectName.required'),
  26. (text: string) => validateNameMaxLength(text) || this.$t('rules.projectName.maxLength')
  27. ]
  28. }
  29. }
  30. })
  31. </script>