-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice2.html
More file actions
51 lines (51 loc) · 1.17 KB
/
practice2.html
File metadata and controls
51 lines (51 loc) · 1.17 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<meta charset="utf-8" />
<script src="https://unpkg.com/vue@next"></script>
<style>
div#app {
padding: 30px;
margin: 30px auto;
width: 400px;
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #aaa;
}
div#app div {
margin-bottom: 20px;
}
label {
display: block;
}
input[type="text"] {
padding: 4px;
}
</style>
</head>
<body>
<div id="app">
<h1>성명</h1>
<div><label>성</label> <input type="text" v-model="lastName" /></div>
<div><label>이름</label> <input type="text" v-model="firstName" /></div>
<hr />
<div><span>{{fullName}}</span></div>
</div>
<script type="text/javascript">
let app = {
data() {
return { lastName: "", firstName: "" };
},
computed: {
fullName: {
get() {
return this.lastName + this.firstName;
},
set(value) {
this.lastName = value - this.firstName;
},
},
},
};
Vue.createApp(app).mount("#app");
</script>
</body>
</html>