我有一组具有“选中”和“取消选中”状态的按钮。如何检查数组中的任何按钮是否处于“选定”状态。
所以基本上我想要类似的东西(使用 Framer 咖啡脚本):
for button in buttonArray
button.onClick ->
this.stateCycle("selected", "default")
if any button in buttonArray state.current == "selected"
activateMainButton()
else
deactivateMainButton()
这是我的原型:http ://share.framerjs.com/11abcrlne5op/ (转到种族部分)。