VUE课时14
v-bind 动态绑定样式(css)
第一种.字符串
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="js/vue.js"></script>
<style>
.red{
color: red;
}
</style>
</head>
<body>
<div id ="app">
<h1 class="red">{
{
msg}}</h1>
<!-- 使用了v-bind去绑定,就会从实例中寻找arg1这个变量,取到red的的样式 -->
<h1 :class="arg1">{
{
msg}}</h1>
</div>
<script><