@@ -75,6 +75,7 @@ function handleMainScroll(e: Event) {
7575const startSideRef = useTemplateRef (' startSideRef' )
7676const endSideRef = useTemplateRef (' endSideRef' )
7777const sideWidth = ref (0 )
78+ const isSupprotRound = CSS .supports (' width' , ' round(up, 1.01px, 1px)' )
7879onMounted (() => {
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