Adds a prefix and a suffix slot for formulate-elements
This commit is contained in:
parent
289bbd2af3
commit
dad7386777
@ -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 () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user