<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-bind指令</title>
    <style type="text/css">
        .bjheise{
            background-color: black;
            color: white;
        }
    </style>
</head>
<body>
    <h3>v-bind指令</h3>
    <div id="app">
        <label for="r1">设置黑色背景,白色字体</label>
        <input type="checkbox" v-model="xianshi" id="r1">
        <br><br>
        <div v-bind:class="{'bjheise':xianshi}">
            v-bind:class指令
        </div>
        <br>
        <div class="bjheise">
            默认样式:没有使用v-bind指令
        </div>
    </div>

    <script src="../js/vue.js"></script>

    <script>
        let vm = new Vue({
            el:'#app',
            data:{
                xianshi:false
            }
        });
    </script>
</body>
</html>