Skip to content

Commit

Permalink
발표 중 사용한 코드
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua1988 committed Oct 11, 2019
1 parent d58bb01 commit c6981c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions dom-handling/handling.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
<body>
<div id="app">
<ul>
<li @click="removeItem">
<li v-for="(item, index) in items"
@click="removeItem(index)">
<span>{{ item }}</span>
<div class="child hide" ref="listItem">
메뉴 설명
</div>
</li>

<!-- <li @click="removeItem">
<span>메뉴 1</span>
<div class="child hide">
메뉴 설명
Expand All @@ -33,7 +41,7 @@
<div class="child hide">
메뉴 설명
</div>
</li>
</li> -->
</ul>
</div>

Expand All @@ -46,7 +54,8 @@
},
methods: {
removeItem(index) {
event.target.lastChild.classList.toggle('hide');
this.$refs.listItem[index].classList.toggle('hide');
// event.target.lastChild.classList.toggle('hide');
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion reacitivity/1_checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
.then(response => response.json())
.then(data => {
this.users = data;
// this.$set(this.users[0], 'checked', false);
this.$set(this.users[0], 'checked', false);
})
.catch(error => console.log(error));
},
Expand Down

0 comments on commit c6981c8

Please sign in to comment.