【问题标题】:How can I use a repeat in AMP carousel如何在 AMP 轮播中使用重复
【发布时间】:2018-10-08 12:03:07
【问题描述】:

我有一个AMP-LIST,其中包括几个items,每个item 都有一些属性。其中一个属性是应该在AMP-CAROUSEL 中使用的图像数组。类似这样的方案:

    <amp-list src="A/JSON/URL">
        <h2>{{somthing}}</h2>
        <p>{{somthing}}</p>
        <amp-carousel>
             ** AN ARRAY IS NEEDED TO BE RENDERED INSIDE HERE**
        </amp-carousel>
    </amp-list>

如何在每个项目的轮播中呈现作为 ITEMS 数组的一部分的 IMAGES 数组

{
  items: [
    {
       prop:value1,
       images:['image1URL','image2URL','image3URL',....],
    },

    {
       prop:value2,
       images:['image4URL','image5URL',....],
    },
  ]
}

【问题讨论】:

  • 你的问题是什么?!由于您的问题描述如此模糊,我建议访问How to Ask 以更好地了解如何提出一个可靠的问题。此外,其他人需要一些错误和更好的解释才能为您提供帮助(他们首先需要了解实际问题是什么)。请相应地编辑您的帖子
  • 重新编辑,请看
  • 编程语言?我也会编辑标签。允许添加类似的编程语言

标签: carousel amp-html amp-list amp-mustache


【解决方案1】:

*** 问题已解决: 顺便说一下,这是一个 AMP-HTML 项目。 我设法通过将 html 代码更改为这样来获得结果:

    <amp-list src="A/JSON/URL">
        <h2>{{somthing}}</h2>
        <p>{{somthing}}</p>
        <amp-carousel>
             {{#TheImageArray}}
                 <img src={{theURL}} />
             {{/TheImageArray}}
        </amp-carousel>
    </amp-list>

【讨论】:

    猜你喜欢
    • 2016-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多