if / else对象使用@@ loop和params gulp-file-include

时间:2019-02-26 06:19:41

标签: gulp

if / else对象使用带有参数gulp-file-include的@@ loop。 无法在@loop中检查对象。

 @@loop('html/components/stacked-cards/stacked-cards.html', [
    {
    "stackedCards": {
    "image": "",
    "orderNum": "54674567",
    "titleBox": "شركة الهدى للصناعات"
    }},
    {
    "stackedCards": {
    "image": "/images/section1.svg",
    "orderNum": "54674567",
    "titleBox": "شركة الهدى للصناعات"
    }},

    ])

    @@if (context.stackedCards.image) {
    //test
    } //not working

    Cannot read property 'orderNum' of undefined: (context.stackedCards.orderNum)

0 个答案:

没有答案