在AMP列表中重新下载

时间:2018-03-16 07:42:12

标签: jquery mustache amp-html amp-list

我正在尝试AMP中的动态下拉菜单我能够获得输出,但其中一个下拉列表因某些原因而被刷新。由于我是小胡子和AMP的新手,我无法弄明白。

以下是输出的链接:https://capellaamp.herokuapp.com/

部分代码:

<amp-list width="auto" height="25" layout="fixed-height" src="https://capellaamp.herokuapp.com/dropdown.json">
      <template type="amp-mustache">
        <select on="
            change:
              AMP.setState({
                test: dropdown.items[0].countries.filter(x => x.name == event.value)[0]
              })">
          <option value="">Choose Degree</option>
          {{#countries}}
          <option value="{{name}}">{{name}}</option>
          {{/countries}}
        </select>
      </template>
    </amp-list>
    <amp-list width="auto" height="25" layout="fixed-height" [src]="test || 'https://capellaamp.herokuapp.com/dropdown.json'" src="https://capellaamp.herokuapp.com/dropdown.json">
      <template type="amp-mustache">
        <select on="
            change:
              AMP.setState({
                test1: test.cities.filter(x => x.name == event.value)[0]
              })">
          <option value="">Choose AOS</option>
          {{#cities}}
          <option value="{{name}}">{{name}}</option>
          {{/cities}}
        </select>
      </template>
    </amp-list>
    <amp-list width="auto" height="25" layout="fixed-height" [src]="test1 || 'https://capellaamp.herokuapp.com/dropdown.json'" src="https://capellaamp.herokuapp.com/dropdown.json">
      <template type="amp-mustache">
        <select>
          <option value="">Choose Specialization</option>
          {{#cities}}
          <option value="{{name}}">{{name}}</option>
          {{/cities}}
        </select>
      </template>
    </amp-list>
    <amp-state id="dropdown" src="https://capellaamp.herokuapp.com/dropdown.json"></amp-state>

从以下链接获取的示例: https://ampbyexample.com/playground/#url=https%3A%2F%2Fampbyexample.com%2Fadvanced%2Flinked_dropdowns%2Fsource%2F&mode=Responsive

0 个答案:

没有答案