我们有 AMP 页面,我们从服务器获取 3 个列表,并将其绑定到客户端。这是相同的小提琴。
但是由于输出是动态的,并且我们将高度指定为 100,因此在此处的代码中,第二个列表返回空 json,我们会看到大量的空白空间,这是不可取的。
获取空列表的代码是:
<amp-list width="auto" height="100" layout="fixed-height" src="https://ampbyexample.com/json/examples-empty.json" class="m1">
<template type="amp-mustache" id="amp-template-id">
<div><a href="{{url}}">{{title}}</a></div>
</template>
</amp-list
我们如何摆脱这个固定高度的 AMP 列表并根据从服务器接收到的内容调整高度?
我在这里读到了类似的东西,但无法理解。有人可以分享如何解决这个问题吗?