add ids, missing :keys...

This commit is contained in:
Tomáš Mládek 2021-04-09 20:31:02 +02:00
parent 85e6fc7670
commit bfc364fe4b
3 changed files with 8 additions and 3 deletions

View file

@ -59,6 +59,7 @@ export default defineComponent({
}); });
export interface AudioAreaDef { export interface AudioAreaDef {
id: string,
cx: number, cx: number,
cy: number, cy: number,
radius: number, radius: number,

View file

@ -5,10 +5,10 @@
</div> </div>
<div class="content" ref="root"> <div class="content" ref="root">
<div class="video-scrolls"> <div class="video-scrolls">
<VideoScroll v-for="scroll in scrolls" :definition="scroll" /> <VideoScroll v-for="scroll in scrolls" :definition="scroll" :key="scroll.id"/>
</div> </div>
</div> </div>
<AudioArea v-for="audio in audioAreas" :definition="audio" :bbox="bbox" /> <AudioArea v-for="audio in audioAreas" :definition="audio" :bbox="bbox" :key="audio.id"/>
<div class="dev devpanel"> <div class="dev devpanel">
<div> <div>
<span>Current viewport position:</span> <span>Current viewport position:</span>
@ -500,6 +500,7 @@ async function processScrolls(svg: XMLDocument): Promise<VideoScrollDef[]> {
} }
return { return {
id: el.id,
top: y * ratio, top: y * ratio,
left: x * ratio, left: x * ratio,
angle, angle,
@ -540,6 +541,7 @@ function processAudio(svg: XMLDocument): AudioAreaDef[] {
el.classList.add("internal"); el.classList.add("internal");
return { return {
id: el.id,
cx: el.cx.baseVal.value, cx: el.cx.baseVal.value,
cy: el.cy.baseVal.value, cy: el.cy.baseVal.value,
radius, radius,

View file

@ -12,7 +12,8 @@
/> />
<!--suppress RequiredAttributes --> <!--suppress RequiredAttributes -->
<img v-for="file in dynamicFiles" <img v-for="(file, idx) in dynamicFiles"
:key="`${idx}_${file.src}`"
:data-src="file.src" :data-src="file.src"
:style="{ :style="{
top: `${Math.round(file.top)}px`, top: `${Math.round(file.top)}px`,
@ -106,6 +107,7 @@ export enum VideoScrollDirection {
} }
export interface VideoScrollDef { export interface VideoScrollDef {
id: string,
top: number, top: number,
left: number, left: number,
angle: number, angle: number,