Skip to content

Commit 9a993e4

Browse files
committed
fix: update button behavior
1 parent 9621a5e commit 9a993e4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/components/atoms/button/button.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,20 @@
2020
:color="iconLeftColor"
2121
:class="{'h-button__icon h-button__icon--position-left': slotPassed}"
2222
/>
23+
2324
<HIcon
2425
v-if="isLoading"
2526
icon="fas fa-circle-notch fa-spin"
2627
class="h-button__icon h-button__icon--is-loading"
2728
/>
29+
2830
<span
29-
v-if="slotPassed"
31+
v-if="slotPassed && !onlyIcon"
3032
:class="{ 'h-button__text': true }"
3133
>
3234
<slot />
3335
</span>
36+
3437
<HIcon
3538
v-if="iconRight"
3639
:icon="iconRight"
@@ -77,6 +80,11 @@ export default {
7780
variant: {
7881
type: String,
7982
default: 'contained',
83+
validator: shouldBeOneOf([
84+
'contained',
85+
'outlined',
86+
'text',
87+
]),
8088
},
8189
size: {
8290
type: String,

src/components/molecules/input-field/input-field.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
>
1212
{{ label }}
1313
</HText>
14+
1415
<slot />
16+
1517
<HText
1618
v-if="helperTextActive"
1719
:color="finalHasError ? 'danger' : 'grey'"
@@ -55,8 +57,8 @@ export default {
5557
},
5658
},
5759
setup(props) {
58-
const $state = reactive({ _hasError: false });
59-
const finalHasError = computed(() => props.hasError || $state._hasError);
60+
const $state = reactive({ hasError: false });
61+
const finalHasError = computed(() => props.hasError || $state.hasError);
6062
provide('hasErrorFromValidate', finalHasError.value);
6163
6264
return { finalHasError };

0 commit comments

Comments
 (0)