<style>
.red {
color:red;
/*color:#ff8800;*/
}
.bg {
background: #000;
/*background: green;*/
}
</style>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
red_color : 'red',
bg_color : 'bg'
}
});
}
<div id="box">
<span :class="[red_color,bg_color]">this is a test string</span>
</div>
<style>
.red {
color:red;
}
.bg {
background: #000;
}
</style>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
}
});
}
<div id="box">
<span :class="{red:true,bg:true}">this is a test string</span>
</div>
<style>
.red {
color:red;
}
.bg {
background: #000;
}
</style>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
r : true,
b : false
}
});
}
<div id="box">
<span :class="{red:r,bg:b}">this is a test string</span>
</div>
<style>
.red {
color:red;
}
.bg {
background: #000;
}
</style>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
json : {
red : true,
bg : false
}
}
});
}
<div id="box">
<span :class="json">this is a test string</span>
</div>
window.onload = function(){
var c = new Vue({
el : '#box',
});
}
<div id="box">
<span :style="{color:'red',background:'#000'}">this is a test string</span>
</div>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
c : {
color : 'green'
}
}
});
}
<div id="box">
<span :style="[c]">this is a test string</span>
</div>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
c : {
color : 'green'
},
b : {
background : '#ff8800'
}
}
});
}
<div id="box">
<span :style="[c,b]">this is a test string</span>
</div>
window.onload = function(){
var c = new Vue({
el : '#box',
data : {
a : {
color:'yellow',
background : '#000'
}
}
});
}
<div id="box">
<span :style="a">this is a test string</span>
</div>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有