vue style三級運算子

qq_40055200發表於2020-12-24
  
<div v-for="(itemFirst,index) in childAccount"              
       @click="changeIndentity(itemFirst.userName)"
       class="text item" :style="{'background-color': (itemFirst.userName==username ?         
       '#F6E3CE':'#F4F4F5')}">
        <div>{{itemFirst.dept.deptName}}</div>
<div v-for="(item,index) in itemFirst.roles" class="role">
<el-link>{{ item.roleName }}</el-link>
</div>
</div>

 

相關文章