vue inline style: style

Dynamic assignment to the Style with Vue, format:

<view :style='{样式名:‘+动态变量+’}'

Where css styles to the "-" need to be replaced hump mode
following record a few common styles:
1. Dynamic assignment to the background image

<view  :style="{backgroundImage:'url('+item.image+')'}">

When applied to replace the corresponding variable item.image

Loading…

Published 24 original articles · won praise 11 · views 5421

Guess you like

Origin blog.csdn.net/weixin_44037376/article/details/97932572