You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
908 B
48 lines
908 B
2 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>样式绑定</title>
|
||
|
<style>
|
||
|
.basic {
|
||
|
width: 400px;
|
||
|
height: 100px;
|
||
|
border: 1px solid black;
|
||
|
}
|
||
|
.happy {
|
||
|
background-color: bisque;
|
||
|
}
|
||
|
.sad {
|
||
|
background-color: blue;
|
||
|
}
|
||
|
.normal {
|
||
|
background-color: orange;
|
||
|
}
|
||
|
.test1 {
|
||
|
background-color: blueviolet;
|
||
|
}
|
||
|
.test2 {
|
||
|
background-color: chartreuse;
|
||
|
}
|
||
|
.test3 {
|
||
|
background-color: brown;
|
||
|
}
|
||
|
</style>
|
||
|
<script type="text/javascript" src="../vue.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
</body>
|
||
|
<div id="root">
|
||
|
<div class="basic">{{name}}</div>
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
Vue.config.productionTip = false
|
||
|
new Vue({
|
||
|
el: "#root",
|
||
|
data:{
|
||
|
name: '测试',
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
</html>
|