mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
perf(nuxt): animate transform rather than width (#19073)
This commit is contained in:
parent
7d0ecb5a96
commit
681cfa83fd
@ -42,12 +42,14 @@ export default defineComponent({
|
|||||||
right: 0,
|
right: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
width: `${indicator.progress.value}%`,
|
width: 'auto',
|
||||||
height: `${props.height}px`,
|
height: `${props.height}px`,
|
||||||
opacity: indicator.isLoading.value ? 1 : 0,
|
opacity: indicator.isLoading.value ? 1 : 0,
|
||||||
background: props.color || undefined,
|
background: props.color || undefined,
|
||||||
backgroundSize: `${(100 / indicator.progress.value) * 100}% auto`,
|
backgroundSize: `${(100 / indicator.progress.value) * 100}% auto`,
|
||||||
transition: 'width 0.1s, height 0.4s, opacity 0.4s',
|
transform: `scaleX(${indicator.progress.value}%)`,
|
||||||
|
transformOrigin: 'left',
|
||||||
|
transition: 'transform 0.1s, height 0.4s, opacity 0.4s',
|
||||||
zIndex: 999999
|
zIndex: 999999
|
||||||
}
|
}
|
||||||
}, slots)
|
}, slots)
|
||||||
|
Loading…
Reference in New Issue
Block a user