我正在尝试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>