I have a problem with a window component.
<div class="text-container" ref="infoRef" :style="transformStyle">
<div class="handle toucher deselect"></div>
<p class="headline deselect" v-html="getHeadline()"></p>
<div class="line"></div>
<div class="copy-container">
<div v-if="showclose==true">
<div class="copy scrollable-area deselect" v-html="store.state.content.impressum.copy"></div>
</div>
<div v-if="showclose==false">
<div v-for="(item, key, index) in store.state.content.steps[contentStep]" :key="index">
<div v-if="getbaseKey(key)=='copy'">
<div class="copy scrollable-area deselect" v-html="item"></div>
</div>
<div v-if="getbaseKey(key)=='final'">
<div class="copy scrollable-area deselect" v-html="item"></div>
</div>
<div v-if="getbaseKey(key)=='bild'">
<img :src="item.image" alt="">
<p class="bu" v-html="item.bu"></p>
</div>
</div>
</div>
</div>
</div>
On the div “text-container” there is a transformStyle() method that does the transformation.
const transformStyle = computed(() => {
// console.log("transformStyle", cardTransformer.x);
if(closed.value == false) {
return {
transform: `translate3d(${cardTransformer.x}px,${cardTransformer.y}px, 0px) rotate(${cardTransformer.rotate}deg) scale(${cardTransformer.scale})`,
// backgroundColor: '#f00',
width: uCurrWidth.value + "px",
height: uCurrHeight.value + "px",
}
} else {
return {
transform: `translate3d(${cardTransformer.x}px,${cardTransformer.y}px, 0px) rotate(${cardTransformer.rotate}deg) scale(${cardTransformer.scale})`,
// backgroundColor: '#f00',
width: uCurrWidth.value + "px",
height: "50px",
}
}
} )
I have now discovered that the content of the v-for loop is constantly being executed during the movement. Neither the content nor the contentStep change, but the content is constantly being re-rendered.