1. 程式人生 > >vue 中動態綁定class 和 style的方法

vue 中動態綁定class 和 style的方法

tail use thead node tps == sdn span tails

先列舉一些例子

:class="[‘content‘,{‘radioModel‘:checkType}]"  
:class
="[‘siteAppListDirNode‘,{open:appitem.open==true}]"

:class="[‘portalCenterMenu‘,{showNav:!showHideNav,hideNav:showHideNav}]"

:class="{shortcutMenuShow:!showHideNav,shortcutMenuHide:showHideNav}"

:style="{height:checkType?‘423px‘:‘385px‘}"

:src
="userInfo.userFace?userInfo.userFace:defaultHead"

轉載: https://blog.csdn.net/weixin_42333548/article/details/80537917

vue 中動態綁定class 和 style的方法