hilongjw / vue-lazyload

A Vue.js plugin for lazyload your Image or Component in your application.
http://hilongjw.github.io/vue-lazyload/
MIT License
8k stars 867 forks source link

How to set background image height by dynamic when use v-lazy:background-image #423

Closed MoonLikeSinging closed 4 years ago

MoonLikeSinging commented 4 years ago

I set an background image, and I use js to get the height, when I use the variable height to set :style={height: height], it's conflict with v-lazy:background-image. How can I use v-lazy:background-image to set the height?

<div class="row" v-lazy:background-image="imageSrc" style="background-repeat: no-repeat; background-size: 100% 100%">

MoonLikeSinging commented 4 years ago

Solved, set parent div's style.height