mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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,
|
||||
left: 0,
|
||||
pointerEvents: 'none',
|
||||
width: `${indicator.progress.value}%`,
|
||||
width: 'auto',
|
||||
height: `${props.height}px`,
|
||||
opacity: indicator.isLoading.value ? 1 : 0,
|
||||
background: props.color || undefined,
|
||||
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
|
||||
}
|
||||
}, slots)
|
||||
|
Loading…
Reference in New Issue
Block a user