When using dom hydrate, the style performance is inconsistent with the dom performance
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
<template>
<div>
<div :style="background-image: url(${bg});"></div>
<div>{{bg}}</div>
</div>
</template>
<script setup>
const bg= ref(transResource(url))
onBeforeMount(() => {
bg.value = transResource(url)
})
</script>
this is a ssr project
transResource
function calculate different url depend on is server or client
but the two bg
renderings above are different
yes, I know hydrate must ensure consistent rendering between the client and server。But when I use it in the wrong way, the page becomes more obvious
What is expected?
The above two bg
render the same
What is actually happening?
When using Vue3 SSR hydrate, for ordinary variables rendered in the dom, if the server-side rendering is inconsistent with the client-side rendering, the client-side variable will be used. However, the style variable bound in the template will not change, which is still the same as the server-side variable
System Info
No response
Any additional comments?
No response