当前位置:网站首页>: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;
}边栏推荐
- 如何让 x == 1 && x == 2 && x == 3 等式成立
- 软件开发模式有哪些(软件工程开发模式)
- C语言学习书籍 零基础入门篇
- ESP8266-Arduino programming example-LittleFS and data upload
- ESP8266-Arduino programming example-I2C device address scan
- 叶酸&适配体修饰DNA纳米载体|CdS纳米颗粒修饰DNA|科研试剂
- LOG4J 学习
- Kubernetes:(四)常用命令
- Omni-channel e-commerce | How can well-known domestic cosmeceuticals seize the opportunity to achieve rapid growth?
- LeetCode_474_一和零
猜你喜欢
随机推荐
荣耀的野望:智慧世界的“高端平民”
通过观测云监控器监控基础资源,自动报警
专家建议|经济低迷周期下如何制订求存的增长战略
单核浏览器和双核浏览器有什么区别,哪个好用?
震荡波病毒原代码(勒索病毒源代码)
模拟量、数字量与开关量的区别
scratch 编程 + 小学数学
include用法及搭配(include相关短语)
【AutoSAR 八 OS】
Kotlin - 协程作用域 CoroutineScope、协程构建器 CoroutineBuilder、协程作用域函数 CoroutineScope Functiom
Mass data query scheme mysql_Mysql massive data storage and solution 2 - Mysql sub-table query massive data... [easy to understand]
LeetCode_474_一和零
【AutoSAR 九 C/S原理架构】
ESP8266-Arduino编程实例-LittleFS及数据上传
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
论文写作全攻略|一篇学术科研论文该怎么写
Sasser virus source code (ransomware source code)
【AutoSAR 五 方法论】
PyQt5快速开发与实战 7.2 信号与槽再细分 && 7.3 信号与槽的高级玩法
Safe Browser will have these hidden features that will let you play around with your browser









