add nova
This commit is contained in:
43
nova/resources/js/fields/Form/EmailField.vue
Normal file
43
nova/resources/js/fields/Form/EmailField.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<DefaultField
|
||||
:field="currentField"
|
||||
:errors="errors"
|
||||
:show-help-text="showHelpText"
|
||||
:full-width-content="fullWidthContent"
|
||||
>
|
||||
<template #field>
|
||||
<input
|
||||
v-bind="extraAttributes"
|
||||
class="w-full form-control form-input form-control-bordered"
|
||||
@input="handleChange"
|
||||
:value="value"
|
||||
:id="currentField.uniqueKey"
|
||||
:dusk="field.attribute"
|
||||
:disabled="currentlyIsReadonly"
|
||||
/>
|
||||
</template>
|
||||
</DefaultField>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DependentFormField, HandlesValidationErrors } from '@/mixins'
|
||||
|
||||
export default {
|
||||
mixins: [HandlesValidationErrors, DependentFormField],
|
||||
|
||||
computed: {
|
||||
extraAttributes() {
|
||||
return {
|
||||
// Leave the default attributes even though we can now specify
|
||||
// whatever attributes we like because the old number field still
|
||||
// uses the old field attributes
|
||||
type: this.currentField.type || 'email',
|
||||
pattern: this.currentField.pattern,
|
||||
placeholder: this.currentField.placeholder || this.field.name,
|
||||
class: this.errorClasses,
|
||||
...this.currentField.extraAttributes,
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user