javascript - Is there a problem with vue :class?
漂亮男人
漂亮男人 2017-05-19 10:28:32
0
2
425


The code is as shown in the figure. I control the true or false of the selectLessonCtrl data element through the click event, but the select class is not added. Is it a problem with $index?

漂亮男人
漂亮男人

reply all(2)
Ty80

Wrong writing, please read the document carefully
Ternary judgment: :class="[xxx ? 'xxx' : 'xxx']"
Is there any: :class="{ active: isActive, 'text-danger': hasError }"
There are other things, it’s best to read the documentation carefully, https://cn.vuejs.org/v2/guide...

淡淡烟草味

Then selectLessonCtrl returns true?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!