前言
最近在使用 Vant-weapp 小程式組件,使用 Card 組件想實作這樣一個界面:

在官方檔案中給出的示例配置中,你根本無法調整中部寬度,,
解決方案
調整如下三個類,具體看下方代碼:
.van-card__bottom:金額 / 虛擬價格 / 數量,那一塊容器,.van-card__img:影像容器,.van-card__thumb:左側容器(影像)
/* 金額/虛擬價格 - 上浮 */
.van-card__bottom{
padding-bottom: 80rpx!important;
}
/* 調整影像大小(最好用百分比) */
.van-card__img{
width: 55%!important;
height: 55%!important;
}
/* 調整左側影像容器 - 使其貼近 */
.van-card__thumb{
margin-right:-44rpx!important;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/147441.html
標籤:AI
