Skip to content

Commit

Permalink
Merge pull request #12 from ahinkle/placeholder-support
Browse files Browse the repository at this point in the history
Custom Placeholder Support
  • Loading branch information
timothyasp authored Oct 26, 2020
2 parents a0141c6 + b0de824 commit 6cc39ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<input :id="field.name" type="text"
class="w-25 form-control form-input form-input-bordered color-input rounded-l-none"
:class="errorClasses"
:placeholder="field.name"
:placeholder="placeholder"
v-model="value"
/>
</div>
Expand Down Expand Up @@ -68,6 +68,16 @@ export default {
*/
palette() {
return this.field.palette || undefined;
},
/**
* Determines the placeholder.
*/
placeholder() {
if (this.field.extraAttributes === undefined) {
return this.field.name;
}
return this.field.extraAttributes.placeholder || this.field.name;
}
}
};
Expand Down

0 comments on commit 6cc39ba

Please sign in to comment.