当前位置: 移动技术网 > IT编程>开发语言>JavaScript > Vue.js05:vue内联样式

Vue.js05:vue内联样式

2019年03月15日  | 移动技术网IT编程  | 我要评论

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

<!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>

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网