中国新闻网首页,诚实守信手抄报,中国煤炭长安网
大致效果如下图,只考虑垂直方向。长图可以通过滚动条看,短图居中效果,布局合理
html代码(vue作用域内):
<div class="box" v-for="item in previewimg"> <img :src="item" alt="" @load="checkheight($event)"> </div>
css代码:
.box{ height: 100%;//如高度等于网页高度 overflow: auto; display: flex; flex-direction: column; justify-content: space-around; } .swiper-slide.long{ justify-content: flex-start; }
js代码(vue作用域内,使用jquery):
methods: { checkheight:function (event) { var el=$(event.currenttarget); el.parent().removeclass('long'); //this.ch 为网页高度 if(el.height()>this.ch){ el.parent().addclass('long'); } } }
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
VUE+elementui组件在table-cell单元格中绘制微型echarts图
Vue通过getAction的finally来最大程度避免影响主数据呈现问题
vue 路由懒加载中给 Webpack Chunks 命名的方法
网友评论