调用轮播图组件时手动设置图片宽度是否需要自适应

 <mt-swipe :auto="4000">
    <mt-swipe-item v-for="(item,i) in list" :key="i">
      <img :src="item.img" alt :class="{'width100':isActive}" />
    </mt-swipe-item>
  </mt-swipe>
 
export default {
  props: ["list", "isActive"]
};
</script>
<style lang="less" scoped>
.mint-swipe {
  height: 200px;
  text-align: center;
  img {
    height: 100%;
  }
  img.width100 {
    width: 100%;
  }
}
posted @ 2020-08-11 10:12  webapp1  阅读(385)  评论(0编辑  收藏  举报