Skip to content

Commit 7e0b449

Browse files
committed
对不支持 CSS round 语法进行降级处理
1 parent 23e9895 commit 7e0b449

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ui/components/FmPageLayout/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function handleMainScroll(e: Event) {
7575
const startSideRef = useTemplateRef('startSideRef')
7676
const endSideRef = useTemplateRef('endSideRef')
7777
const sideWidth = ref(0)
78+
const isSupprotRound = CSS.supports('width', 'round(up, 1.01px, 1px)')
7879
onMounted(() => {
7980
const { width: startWidth } = useElementSize(startSideRef, undefined, { box: 'border-box' })
8081
const { width: endWidth } = useElementSize(endSideRef, undefined, { box: 'border-box' })
@@ -135,7 +136,7 @@ function handleBackTopClick() {
135136
<div class="min-h-[var(--g-navbar-min-height)] w-full flex-center">
136137
<div
137138
class="h-full flex items-center justify-start" :style="{
138-
...(titleCenter && sideWidth && { width: `round(up, ${sideWidth}px, 1px)` }),
139+
...(titleCenter && sideWidth && { width: isSupprotRound ? `round(up, ${sideWidth}px, 1px)` : `${Math.ceil(sideWidth)}px` }),
139140
}"
140141
>
141142
<div ref="startSideRef" class="h-full flex-center whitespace-nowrap">
@@ -157,7 +158,7 @@ function handleBackTopClick() {
157158
</div>
158159
<div
159160
class="h-full flex items-center justify-end" :style="{
160-
...(titleCenter && sideWidth && { width: `round(up, ${sideWidth}px, 1px)` }),
161+
...(titleCenter && sideWidth && { width: isSupprotRound ? `round(up, ${sideWidth}px, 1px)` : `${Math.ceil(sideWidth)}px` }),
161162
}"
162163
>
163164
<div ref="endSideRef" class="h-full flex-center whitespace-nowrap">

0 commit comments

Comments
 (0)