我正在尝试创建以下 UI/UX 按钮:
.. [2015] [2016] [2017]
当前年份(在撰写本文时为 2017 年)默认为“选择”,但是,当用户单击“2015”时,应取消选择“2017”和“2016”(这些按钮是“互斥的”)
这些按钮是从一个为我提供多年数据的外部数据源生成的:
<button *ngFor="let year of styles.years" type="button" name="button" class="btn btn-default" id="{{year.year}}">
{{year.year}}
</button>
How can I create a system of buttons where one button is 'auto-selected', and when 'other' button is selected, it deselects the button that's actively selected, and sets the now clicked button to 'selected'?