想做一个导航菜单,点击时黑色的icon变成白色的,点击切换很容易,但是要循环并且对应切换,自己就想复杂了
首先试了好几种思路都不行,最后直接用 v-if 实现,判断点击的是否为当前元素
其实是一件很简单的事,但是把它想得太复杂了