当前位置:网站首页>:class数组写法
:class数组写法
2022-07-29 19:49:00 【无围之解】
:class="[
'submit-btn',
activeCss,
{
'hidden-btn': (fullState == 4 && isEdite),
},
]"
<div :class="['tag', activeTag]">
computed: {
activeTag() {
if (this.fullState == 3) {
return 'yellow-btn'
} else {
return 'gray-btn'
}
},
activeCss() {
if (this.fullState == 3 && !this.limited && this.audience) {
return 'yellow-btn'
} else {
return 'gray-btn'
}
},
},
然后在css中
.gray-btn {
color: #666666;
background: #ececec;
}
.yellow-btn {
color: #ffffff;
background: #ffaa1e;
}
边栏推荐
- ESP8266-Arduino编程实例-EEPROM读写
- 虚假新闻检测论文阅读(六):A Deep Learning Model for Early Detection of Fake News on Social Media
- ACM学习书籍简介
- GNOME将在Secure Boot被禁用时向用户发出警告 并准备提供安全帮助
- 通过观测云监控器监控基础资源,自动报警
- 【AutoSAR 六 描述文件】
- JUC Concurrent Programming Basics AQS
- Briefly talk about K-means clustering
- There is a fee for the picture bed software. Forget it, I wrote an open source free one.
- [数学基础]概率论与数理统计相关概念学习
猜你喜欢
常用电源符号含义分享
如何把thinkphp5的项目迁移到阿里云函数计算来应对流量洪峰?
聚丙烯微孔膜的等离子体改性及DNA|有机自由基改性DNA-阳离子脂质复合体的应用
Single-core browser and what is the difference between dual-core browser, which to use?
腾讯安全发布 Tencent Cloud EdgeOne,为企业出海打造安全加速一体化服务
【AutoSAR 一 概述】
PEG-siRNA-PCL|siRNA-PEG-LHRH|MPEG-siRNA 甲氧基聚乙二醇修饰核酸
百度实习学弟深夜吐槽:原来大厂是这种生活啊
荣耀的野望:智慧世界的“高端平民”
【AutoSAR 十 IO架构】
随机推荐
cpolar应用实例之助力航运客户远程办公
【Autosar 启动流程详解】
正则表达式
图床软件要收费,算了我自己写一个开源免费的。
ESP8266-Arduino programming example-LittleFS and data upload
Experience Sharing | Tips for Writing Easy-to-Use Online Product Manuals
LeetCode #88.合并两个有序数组
C语言学习书籍(提高篇)
使用IDEA连接mysql
Detailed explanation of design ideas of webUI test framework
4D Summary: 38 Knowledge Points of Distributed Systems
There is a fee for the picture bed software. Forget it, I wrote an open source free one.
用对象字面量或Map替代Switch/if语句
荧光量子点修饰siRNA-QDs|纳米金修饰siRNA-Au(RNA修饰方式方法)
软件开发模式有哪些(软件工程开发模式)
RNA修饰技术介绍|介孔二氧化硅纳米颗粒(MSN)搭载的微小RNA-24(miR-24)纳米载体复合物
GNOME将在Secure Boot被禁用时向用户发出警告 并准备提供安全帮助
8.2实训任务 Sqoop的安装与配置
安全浏览器将拥有这些隐藏功能,让你玩转浏览器
【AutoSAR 七 工具链简介】