我用vue-waterfall做瀑布流布局,希望兩列布局,兩列都緊靠屏幕兩邊,中間留出空白。上代碼: <waterfall :line-gap='screenW'> <!-- each component is wrapped by a waterfall slot --> <waterfall-slot v-for="(video, index) in videoList" class='items' :width='screenW' :height='video.height * screenW / video.width + 40' :order='index' :key='video.auid' > <img :src='video.coverurl' alt=""> <div class='user-info-box'> <img class='userlogo' :src='video.logourl' alt=""> <span class='userName'>{{ video.username }}</span> </div> </waterfall-slot> </waterfall> data () { return { screenW: window.screen.width * 0.49 } } 這樣做出來是兩列緊靠在一起,居左,屏幕右邊留白了 然后我給index%2===0的加了marginLeft希望把右邊的頂過去,才想起來在左邊的index不一定是奇數,請問大神我應該咋辦
利用vue-waterfall做瀑布流的問題?
LEATH
2018-12-21 19:15:13