1
0
mirror of synced 2025-01-19 17:01:43 +03:00

Adds a prefix and a suffix slot for formulate-elements

This commit is contained in:
Justin Schroeder 2019-02-26 10:54:16 -05:00
parent 289bbd2af3
commit dad7386777

View File

@ -1,5 +1,6 @@
<template> <template>
<div :class="classes"> <div :class="classes">
<slot name="prefix" />
<div <div
class="formulate-element-input-wrapper" class="formulate-element-input-wrapper"
:data-type="type" :data-type="type"
@ -143,6 +144,7 @@
/> />
</transition-group> </transition-group>
</transition> </transition>
<slot name="suffix" />
</div> </div>
</template> </template>
@ -311,7 +313,9 @@ export default {
'formulate-element': true, 'formulate-element': true,
[`formulate-element--type--${this.type}`]: true, [`formulate-element--type--${this.type}`]: true,
'formulate-element--has-value': !!this.value, 'formulate-element--has-value': !!this.value,
'formulate-element--has-errors': this.localAndValidationErrors.length && this.shouldShowErrors 'formulate-element--has-errors': this.localAndValidationErrors.length && this.shouldShowErrors,
'formulate-element--has-prefix': !!this.slots.prefix,
'formulate-element--has-suffix': !!this.slots.suffix
} }
}, },
validationErrors () { validationErrors () {