我有疑问,我需要在vue.js中添加v-bind和v-for到同一类吗?
<div class="printIconSection" v-for="report in reports" :key="report.property" >
<div class="printIcon" id="printReport_AId" v-if="isOverview">
<font-awesome-icon :icon="report.icon" @click="printWindow()"/>
</div>
</div>
我需要在printIconSection类中添加v-bind:class =“ {'title-long':changeTitle}”。
如何结合?建议吗?
答案 0 :(得分:0)
<div
v-for="report in reports"
:key="report.property"
:class="['printIconSection', { 'title-long' : changeTitle }]">
<div class="printIcon" id="printReport_AId" v-if="isOverview">
<font-awesome-icon :icon="report.icon" @click="printWindow()"/>
</div>
</div>
尝试执行此操作。 希望对您有帮助