"pre-load" first image
This commit is contained in:
parent
b2f2420df9
commit
18e43839d1
1 changed files with 10 additions and 2 deletions
|
@ -1,10 +1,18 @@
|
|||
<template>
|
||||
<div class="video-scroll" ref="root">
|
||||
<img v-for="(file, idx) in definition.files"
|
||||
<img class="visible loaded"
|
||||
:src="definition.files[0]"
|
||||
:style="{
|
||||
top: `${Math.round(definition.top)}px`,
|
||||
left:`${Math.round(definition.left)}px`,
|
||||
}"
|
||||
/>
|
||||
|
||||
<img v-for="(file, idx) in definition.files.slice(1)"
|
||||
:data-src="file"
|
||||
:style="{
|
||||
top: `${Math.round(definition.top)}px`,
|
||||
left: `${Math.round(definition.left) + width * idx}px`,
|
||||
left: `${Math.round(definition.left) + width * (idx + 1)}px`,
|
||||
}"
|
||||
/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue