• css实现瀑布流,复制粘贴直接用就好了,会这一个就够了


    效果图


     

    html篇,小程序或者app 改一下标签即可了


    1. <view class="pubu-box">
    2. <view class="pubu-item">
    3. <view class="item-masonry" v-for="(item, index) in saleMostProducts" :key="index">
    4. <image :src="item.pic" mode="widthFix">image>
    5. <view class="text-area">
    6. <view class="gname">{{ item.brandName }}view>
    7. <view class="price-origin">
    8. <text class="price">¥{{ item.price | money }}text>
    9. <text class="origin">{{ item.origin_city }}text>
    10. view>
    11. view>
    12. view>
    13. view>
    14. view>
    15. view>

    数据


    1. LatestProducts: [
    2. {
    3. id: 1,
    4. name:'哈士奇',
    5. pic:'https://img0.baidu.com/it/u=3155484156,3023508163&fm=253&fmt=auto&app=138&f=JPEG?w=200&h=200',
    6. price:'888',
    7. promotionPrice:'688',
    8. },
    9. {
    10. id: 2,
    11. name:'金毛',
    12. pic:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202001%2F18%2F20200118170220_ybnwc.thumb.1000_0.jpg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1698330041&t=6af3ef9d11331f0ae039eecfae91aae1',
    13. price:'888',
    14. promotionPrice:'688',
    15. },
    16. {
    17. id: 3,
    18. name:'柯基',
    19. pic:'https://img2.baidu.com/it/u=2861718613,1314475965&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
    20. price:'888',
    21. promotionPrice:'688',
    22. },
    23. {
    24. id: 4,
    25. name:'德牧',
    26. pic:'https://pic.bbs.ybvv.com/forum/201812/02/185753fkaayvvk7zca77ak.jpg',
    27. price:'888',
    28. promotionPrice:'688',
    29. },
    30. ],

     css 采用的是sass记得style标签上浪(lang)一下


    1. .pubu-box {
    2. .pubu-item {
    3. column-count: 2;
    4. column-gap: 20rpx;
    5. .item-masonry {
    6. box-sizing: border-box;
    7. border-radius: 15rpx;
    8. overflow: hidden;
    9. background-color: #fff;
    10. break-inside: avoid;
    11. /*避免在元素内部插入分页符*/
    12. box-sizing: border-box;
    13. margin-bottom: 20rpx;
    14. // box-shadow: 0px 0px 28rpx 1rpx rgba(78, 101, 153, 0.14);
    15. image {
    16. width: 100%;
    17. }
    18. .text-area {
    19. padding: 36rpx;
    20. font-size: 26rpx;
    21. .gname {
    22. color: #3e3e3e;
    23. line-height: 38rpx;
    24. margin-top: 8rpx;
    25. font-weight: bold;
    26. text-overflow: ellipsis;
    27. overflow: hidden;
    28. white-space: nowrap;
    29. }
    30. .price-origin {
    31. display: flex;
    32. justify-content: space-between;
    33. align-items: center;
    34. margin-top: 20rpx;
    35. .origin {
    36. color: #3e3e3e;
    37. overflow: hidden;
    38. white-space: nowrap;
    39. text-overflow: ellipsis;
    40. }
    41. }
    42. }
    43. }
    44. }
    45. }

  • 相关阅读:
    旋转偏心裁切刀切向跟踪及半径补偿
    【云计算】三种云服务
    硅谷来信:Google、Facebook员工的“成长型思维”
    8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)
    【代码扫描修复】不安全的反序列化攻击(高危)
    【0107】 启动XLOG机制(1)
    Springboot与RestTemplate
    神经网络参数量和计算量,神经网络参数个数计算
    Java项目:ssm课程在线学习与测试系统
    小米手机买什么蓝牙耳机好?适配小米手机的蓝牙耳机推荐
  • 原文地址:https://blog.csdn.net/weixin_52901235/article/details/133340815