對象就是無序鍵值對的集合 ...
對象就是無序鍵值對的集合
<!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>