image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue.js 样式-style(内联样式)-绑定样式数组</title>
    <script src="//static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
        <div>城南博客</div>
        <div v-bind:style="[cs1,cs2]">城南花开</div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                cs1:{
                    fontSize:"30px"
                },
                cs2:{
                    color:"red"
                }
            }
        })
    </script>
</body>
</html>