简体   繁体   中英

amp-list height doesn't update

I am triyng to get working this dynamic amp-list getting data from dynamic json. Everithing works fine but the amp-list is not dynamic, it should change after every loading

<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

Try AMP-Live-List . AMP-List is static.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM