simpleCart js缩略图未定义

simpleCart js thumbnail images undefined

本文关键字:未定义 略图 js simpleCart      更新时间:2023-09-26

如果我发现很多人都在问同样的问题,那就有好处了。获取要显示的缩略图。

项目设置:

<div class="simpleCart_shelfItem">
        <img src="images/buttons.png" alt="Sample Product" class="item_thumb" thumb="images/buttonsthumb.png">
          <h2 class="item_name"> Awesome T-shirt </h2>
        <p>  <input type="text" value="1" class="item_Quantity"><br>
          <span class="item_price">$35.99</span><br>
          <a class="item_add" href="javascript:;"> Add to Cart </a></p>
        </div>

注意:该图像具有item_thumb类和thumb属性,其中的值是缩略图的url。

推车设置:

simpleCart({
cartColumns: [
    { view: "image" , attr: "thumb", label: false },
    { attr: "name" , label: "Name" } ,
    { attr: "price" , label: "Price", view: 'currency' } ,
    { view: "decrement" , label: false , text: "-" } ,
    { attr: "quantity" , label: "Qty" } ,
    { view: "increment" , label: false , text: "+" } ,
    { attr: "total" , label: "SubTotal", view: 'currency' } ,
    { view: "remove" , text: "Remove" , label: false }
]
});

我不是专家,但这就是我工作的方式。希望这能帮助到别人。如果有人有更好的方法/解释,请告诉我。