vue动态改变style

2019-12-05  本文已影响0人  风吹路过的云

在使用vue开发的过程中,有些时候你会发现,虽然你的元素已经有了一个class样式了,但还是有需要动态改变某个样式的需求,那要怎么处理呢,如下的代码块段

<div class="executing" :style="{'background':(item.lineColor ? item.lineColor : '#1876d2')}"
    v-if="job.lineNodeStatus == 4">
    {{ job.lineNodeStatus | statusNameFilter }}
</div>
<el-container v-for="(item, index) in allLine"
    :key="index" :style="{'border-left-color':item.lineColor, 'border-left-width':'5px', 'border-left-style': 'solid'}">
</el-container>
上一篇 下一篇

猜你喜欢

热点阅读