Dynamic binding of v-bind

the bind-V  Vue dynamic binding of a command attribute assignment
   Syntax : v-bind: attribute (parameter) = "variable value"
<!DOCTYPE html>
<html lang="en">

 

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        .red {
            color: blue;
        }

 

        .font {
            font-size: 40px;
        }
    </style>
</head>

 

<body>
    <div v-html="rawHtml" id="app"  v-bind:class="{red:isRed,font:isFont}"></div>
    <div id="app1"  v-bind:style="{color:color,fontSize:fontSize}">listen and point</div>
    <script>
        There vm = new Vue ({
            el: "#app",
            data: {
                rawHtml: "<span>hello world111</span>",
                isRed:true,
                isFont:true,
            }
        });
        was VM1 = new Vue ({
            el: "#app1",
            data: {
                color: "red",
                fontSize: '50px',
            }
        });
    </script>
</body>

 

</html>

Guess you like

Origin www.cnblogs.com/kukai/p/12382340.html