<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
    .textcolor{
        color:aquamarine;
    }
    .textsize{
        font-size: 50px;
    }
    </style>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
    <div id="vueApp">
        <h1>Vue.js元素绑定多个样式简单学习</h1>
        <h2 v-bind:class="textclass">class你好</h2>
        <h2 :class="textclass">样式你好</h2>
        <p>样式是对象键名为样式,键值为布尔判断值</p>
        <button v-on:click="changeColor()">点击我试一试</button>
    </div>
</body>
<script>
    let vueApp=new Vue({
        el:"#vueApp",
        data:{
            textclass:{
                textcolor:true,
                textsieze:true,
            }
        },
        methods:{
            changeColor:function(){
                this.textclass.textcolor=!this.textclass.textcolor;
                this.textclass.textsize=!this.textclass.textsize;
            }
        }
        
    }
    );
</script>
</html>