1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div :style="{ color: red, fontSize: size}">Hello</div>
        <button @click="update">Click</button>
    </div>
 
    <script>
        new Vue ({
            el: '#app',
            data :{
               red : 'red',
               size : '30px' 
            },
        });
    </script>
</body>
</html>
cs


'Vue' 카테고리의 다른 글

v-for 리스트렌더딩  (0) 2020.02.15
v-if, v-show 버튼클릭시 보이게 안보이게  (0) 2020.02.15
클래스 스타일 변경하기  (0) 2020.02.15
바인딩 양방향바인딩  (0) 2020.02.10
컴포넌트 불러오기  (0) 2019.08.27

+ Recent posts