cui-goods-list插件的使用

这是一个关于前端UI布局的示例,展示了如何使用flexbox布局展示商品列表,并实现加载更多的功能。每个商品项以卡片形式展示,包含图片、商品名称和价格信息,列表可以自动换行排列。当列表不为空时,显示‘加载更多’按钮,点击可触发获取更多商品数据的回调函数。
 <div class="goods-list">
    <div class="items">
      <cui-goods-list v-for="it in goodsList" :key="it.id" :goodsInfo="it"></cui-goods-list>
    </div>
    <div class="more-box" v-if="goodsList.length">
      <mt-button class="more" size="large" @click="getMore">加载更多</mt-button>
    </div>
  </div>

.goods-list {
  .items {
    display: flex;
    flex-flow: row wrap;
    padding: 0.2rem 0.3rem;
    background-color: #fff;
    a {
      width: 100%;
    }
    .item {
      width: calc(50% - 10px);
      margin-top: 10px;
      margin-right: 10px;
      background: #fff;
      border-radius: 5px;
      display: flex;
      flex-flow: column nowrap;
      text-align: left;
      padding: 10px;
      img {
        width: 100%;
      }
      h4 {
        font-size: 14px;
        line-height: 22px;
        height: 44px;
        color: #333;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
      }
      p {
        margin-bottom: 0;
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        .red {
          color: red;
        }
      }
    }
  }
  .more-box {
    margin: 5px 10px 0;
    .mint-button{
      font-size: 12px;
      background-color: transparent;
      height: 35px;
    }
  }
}
</style>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值