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="mycss">城南花开</div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                mycss:{
                    color:"red",
                    fontSize:"30px"
                }
            }
        })
    </script>
</body>
</html>