<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css样式控制</title>
<style type="text/css">
div>div{
width: 60px;
height: 60px;
border: 2px solid #bbbbbb;
text-align: center;
line-height: 60px;
font-size: 30px;
margin: 10px;
float: left;
}
.selected{
border-color: #000000;
}
.active{
background-color: #bbbbbb;
}
</style>
</head>
<body>
<div id="app">
<div>1</div>
<div v-bind:style="{'border-color':selected}">2</div>
<div v-bind:style="{'background':active}">3</div>
<div v-bind:style="{'borderColor':selected,'background':active}">4</div>
</div>
<script src="../js/vue.js"></script>
<script>
let vm = new Vue({
el:'#app',
data:{
selected:'#000',
active:'#bbb'
}
});
</script>
</body>
</html>
vue-前端第4章class08.html
原创
©著作权归作者所有:来自51CTO博客作者虾米大王的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
vue-前端第4章class10.html
【代码】vue-前端第4章class10.html。
javascript vue.js 前端 html d3 -
vue-前端第4章class06.html
【代码】vue-前端第4章class06.html。
javascript vue.js 前端 html css -
vue-前端第4章class04.html
【代码】vue-前端第4章class04.html。
javascript 前端 css html Math -
vue-前端第4章class02.html
【代码】vue-前端第4章class02.html。
css html 前端 vue.js -
vue-前端第4章class12.html
【代码】vue-前端第4章class12.html。
javascript vue.js css html -
vue-前端第4章class05.html
【代码】vue-前端第4章class05.html。
javascript vue.js 前端 html css -
vue-前端第4章class09.html
【代码】vue-前端第4章class09.html。
javascript vue.js css html -
vue-前端第4章class03.html
【代码】vue-前端第4章class03.html。
javascript vue.js css html -
vue-前端第4章class01.html
【代码】vue-前端第4章class01.html。
css html 前端 vue.js -
vue-前端第4章class11.html
【代码】vue-前端第4章class11.html。
javascript vue.js 前端 d3 html -
vue-前端第4章class07.html
【代码】vue-前端第4章class07.html。
javascript vue.js 前端 html css -
vue-前端第2章instance08.html
【代码】vue-前端第2章instance08.html。
javascript vue.js 前端 html ci -
vue-前端第9章component08.html
【代码】vue-前端第9章component08.html。
vue.js javascript 前端 html Vue -
vue-前端第5章event08.html
【代码】vue-前端第5章event08.html。
javascript css html 修饰符 -
vue-前端第6章form08.html
【代码】vue-前端第6章form08.html。
javascript 前端 vue.js html python -
vue-前端第7章v-if08.html
【代码】vue-前端第7章v-if08.html。
vue.js javascript 前端 html Vue -
vue-前端第3章watch08.html
【代码】vue-前端第3章watch08.html。
vue.js javascript 前端 html 数组 -
vue-前端第12章transition08.html
【代码】vue-前端第12章transition08.html。
vue.js html Math css -
vue-案例教程第4章08.html
【代码】vue-案例教程第4章08.html。
vue.js Math html javascript