欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Vue.js05:vue内联样式

程序员文章站 2022-10-05 08:40:07
对象就是无序键值对的集合 ......

对象就是无序键值对的集合

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1 on-cloak>{{ msg }}</h1>
        <h1 :style="{color: 'red', 'font-width': 200}">周日被我射熄火了,所以今天是周一</h1>
        <h1 :style="styleobj2">起床起床,老板喊你加班了</h1>
        <h1 :style="styleobj3">小乔,要努力变强</h1>
    </div>
</body>
<script>
    let vm = new new vue({
        el: '#app',
        data: {
            msg: '瞅你咋地?再瞅一个试试',
            styleobj1: {color: 'red', 'font-width': 200},
            styleobj2: {'font-style': 'italic'},
            styleobj3: {color: 'skyblue', 'font-width': 400}
        },
        methods: {
            
        }
    })
</script>
</html>