@@ -69,11 +69,11 @@ const props = withDefaults(defineProps<BAvatarProps>(), {
69
69
variant: ' secondary' ,
70
70
})
71
71
72
- const booleanBadgeLeft = computed (() => resolveBooleanish (props .badgeLeft ))
73
- const booleanBadgeTop = computed (() => resolveBooleanish (props .badgeTop ))
74
- const booleanButton = computed (() => resolveBooleanish (props .button ))
75
- const booleanDisabled = computed (() => resolveBooleanish (props .disabled ))
76
- const booleanSquare = computed (() => resolveBooleanish (props .square ))
72
+ const badgeLeftBoolean = computed (() => resolveBooleanish (props .badgeLeft ))
73
+ const badgeTopBoolean = computed (() => resolveBooleanish (props .badgeTop ))
74
+ const buttonBoolean = computed (() => resolveBooleanish (props .button ))
75
+ const disabledBoolean = computed (() => resolveBooleanish (props .disabled ))
76
+ const squareBoolean = computed (() => resolveBooleanish (props .square ))
77
77
78
78
interface BAvatarEmits {
79
79
(e : ' click' , value : MouseEvent ): void
@@ -118,7 +118,7 @@ const computedRounded = computed<string | boolean>(() =>
118
118
119
119
const attrs = computed (() => ({
120
120
' aria-label' : props .ariaLabel || null ,
121
- ' disabled' : booleanDisabled .value || null ,
121
+ ' disabled' : disabledBoolean .value || null ,
122
122
}))
123
123
124
124
const badgeClasses = computed (() => ({
@@ -134,18 +134,18 @@ const badgeTextClasses = computed<string>(() => {
134
134
const classes = computed (() => ({
135
135
[` b-avatar-${props .size } ` ]: props .size && SIZES .indexOf (computeSize (props .size )) !== - 1 ,
136
136
[` bg-${computedVariant .value } ` ]: computedVariant .value ,
137
- [` badge ` ]: ! booleanButton .value && computedVariant .value && hasDefaultSlot .value ,
137
+ [` badge ` ]: ! buttonBoolean .value && computedVariant .value && hasDefaultSlot .value ,
138
138
rounded: computedRounded .value === ' ' || computedRounded .value === true ,
139
- [` rounded-circle ` ]: ! booleanSquare .value && computedRounded .value === ' circle' ,
140
- [` rounded-0 ` ]: booleanSquare .value || computedRounded .value === ' 0' ,
141
- [` rounded-1 ` ]: ! booleanSquare .value && computedRounded .value === ' sm' ,
142
- [` rounded-3 ` ]: ! booleanSquare .value && computedRounded .value === ' lg' ,
143
- [` rounded-top ` ]: ! booleanSquare .value && computedRounded .value === ' top' ,
144
- [` rounded-bottom ` ]: ! booleanSquare .value && computedRounded .value === ' bottom' ,
145
- [` rounded-start ` ]: ! booleanSquare .value && computedRounded .value === ' left' ,
146
- [` rounded-end ` ]: ! booleanSquare .value && computedRounded .value === ' right' ,
147
- btn: booleanButton .value ,
148
- [` btn-${computedVariant .value } ` ]: booleanButton .value ? computedVariant .value : null ,
139
+ [` rounded-circle ` ]: ! squareBoolean .value && computedRounded .value === ' circle' ,
140
+ [` rounded-0 ` ]: squareBoolean .value || computedRounded .value === ' 0' ,
141
+ [` rounded-1 ` ]: ! squareBoolean .value && computedRounded .value === ' sm' ,
142
+ [` rounded-3 ` ]: ! squareBoolean .value && computedRounded .value === ' lg' ,
143
+ [` rounded-top ` ]: ! squareBoolean .value && computedRounded .value === ' top' ,
144
+ [` rounded-bottom ` ]: ! squareBoolean .value && computedRounded .value === ' bottom' ,
145
+ [` rounded-start ` ]: ! squareBoolean .value && computedRounded .value === ' left' ,
146
+ [` rounded-end ` ]: ! squareBoolean .value && computedRounded .value === ' right' ,
147
+ btn: buttonBoolean .value ,
148
+ [` btn-${computedVariant .value } ` ]: buttonBoolean .value ? computedVariant .value : null ,
149
149
}))
150
150
151
151
const textClasses = computed <string >(() => {
@@ -161,10 +161,10 @@ const badgeStyle = computed<StyleValue>(() => {
161
161
: ' '
162
162
return {
163
163
fontSize: fontSize || ' ' ,
164
- top: booleanBadgeTop .value ? offset : ' ' ,
165
- bottom: booleanBadgeTop .value ? ' ' : offset ,
166
- left: booleanBadgeLeft .value ? offset : ' ' ,
167
- right: booleanBadgeLeft .value ? ' ' : offset ,
164
+ top: badgeTopBoolean .value ? offset : ' ' ,
165
+ bottom: badgeTopBoolean .value ? ' ' : offset ,
166
+ left: badgeLeftBoolean .value ? offset : ' ' ,
167
+ right: badgeLeftBoolean .value ? ' ' : offset ,
168
168
}
169
169
})
170
170
@@ -184,15 +184,15 @@ const marginStyle = computed(() => {
184
184
return value ? {marginLeft: value , marginRight: value } : {}
185
185
})
186
186
187
- const tag = computed <string >(() => (booleanButton .value ? props .buttonType : ' span' ))
187
+ const tag = computed <string >(() => (buttonBoolean .value ? props .buttonType : ' span' ))
188
188
const tagStyle = computed (() => ({
189
189
... marginStyle .value ,
190
190
width: computedSize .value ,
191
191
height: computedSize .value ,
192
192
}))
193
193
194
194
const clicked = (e : MouseEvent ): void => {
195
- if (! booleanDisabled .value && booleanButton .value ) emit (' click' , e )
195
+ if (! disabledBoolean .value && buttonBoolean .value ) emit (' click' , e )
196
196
}
197
197
const onImgError = (e : Event ): void => emit (' img-error' , e )
198
198
</script >
0 commit comments