🌐 AI搜索 & 代理 主页
Skip to content

Commit 9d4507d

Browse files
authored
Update avatar.js
1 parent 3ad1a2b commit 9d4507d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/avatar/avatar.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const RX_NUMBER = /^[0-9]*\.?[0-9]+$/
1717

1818
const FONT_SIZE_SCALE = 0.4
1919
const BADGE_FONT_SIZE_SCALE = FONT_SIZE_SCALE * 0.7
20-
export const GROUP_MARGIN_SCALE = FONT_SIZE_SCALE * 0.375
2120

2221
const DEFAULT_SIZES = {
2322
sm: '1.5em',
@@ -193,9 +192,11 @@ export const BAvatar = /*#__PURE__*/ Vue.extend({
193192
return fontSize ? { fontSize } : {}
194193
},
195194
marginStyle() {
196-
let value = this.computedSize
197-
value = value ? `calc(${value} * -${GROUP_MARGIN_SCALE})` : null
198-
return value && this.bvAvatarGroup ? { marginLeft: value, marginRight: value } : {}
195+
const avatarGroup = this.bvAvatarGroup
196+
const overlapScale = avatarGroup ? avatarGroup.overlapScale : 0
197+
const size = this.computedSize
198+
const value = size && overlapScale ? `calc(${size} * -${overlapScale})` : null
199+
return value ? { marginLeft: value, marginRight: value } : {}
199200
},
200201
badgeStyle() {
201202
const { computedSize: size, badgeTop, badgeLeft, badgeOffset } = this

0 commit comments

Comments
 (0)