amp-list height不会更新

时间:2017-10-03 16:22:47

标签: amp-html

我很想让这个动态放大器列表从动态json中获取数据。 Everithing工作正常但是amp-list不是动态的,它应该在每次加载后改变

<amp-list class="products-category" width="auto" height="700" layout="fixed-height" [src]="myState.items" src="/dropshipping/__AMP_get_products.php" id="show-more-list">
    <template type="amp-mustache">
        <a href="{{url}}" class="tile" role="listitem">
           <amp-img width="130" height="130" layout="fixed" alt="{{name}}" src="{{img}}"></amp-img>
           <div class="product_name">{{name}}</div>
           <div class="short_description">{{description}}</div>
           <div class="price">
                <span class="list-price">&euro;{{list-price}}</span>
                <span class="sell-price">&euro;{{sell-price}}</span>
           </div>
        </a>
    </template>
</amp-list>

<amp-state id="myState" src="/dropshipping/__AMP_get_products.php"></amp-state>
    <form method="GET" action="/dropshipping/__AMP_get_products.php" action-xhr="/dropshipping/__AMP_get_products.php" target="_top"
        on="submit-success: AMP.setState({
            myState: { items: myState.items.concat(event.response.items)},
            product: {index: product.index + 1,
            hasMorePages: event.response.hasMorePages}
        });">
        <input type="hidden" name="index" value="0" [value]="product.index">
        <input type="submit" value="Mostra altri prodotti" [class]="(product.hasMorePages == false ? 'hide' : 'ampstart-btn caps m1 mb3 show')">
    </form>

https://www.nutritioncenter.it/proteine/?amp

1 个答案:

答案 0 :(得分:1)

试试AMP-Live-List。 AMP-List是静态的。

相关问题