📜  vue 类添加 if - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:48.748000             🧑  作者: Mango

代码示例4
vue class binding if else
:class="darkMode ? 'dark-theme' : 'light-theme'" If darkMode is true, we apply dark-theme as our class name. Otherwise we choose light-theme.