You should not have pug tags with multiple attributes

早过忘川 提交于 2019-12-04 12:01:46

The problem is you're trying to define attributes twice, try it like this and it should work:

div.collapse.col-md-3(class=(tweetData.index === index ? "blueGlow" : undefined), data-index=index)

Although it's just a preference, you don't need to use a div since by default pug uses a div as an element when you omit it. Also, you can minimize your conditional line by making use of the && logical operator:

.collapse.col-md-3(class=(tweetData.index === index && "blueGlow"), data-index=index)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!