문제 1
var vm = new Vue({
data: {
treeData:{
a:{
b:{
e:undefined
},
c:{
f:{
k:undefined
},
g:undefined,
h:undefined
},
d:{
i:undefined,
j:undefined
}
}
}
},
created(){
this.find_deepest_child();
this.find_nodes_that_contains_more_than_three_children();
this.count_all_distributions_of_key('c');
},
methods: {
//treeData를 이용해 아래 함수를 모두 채우세요.
find_deepest_child(){
// 최종 return :: k
},
find_nodes_that_contains_more_than_two_children: function(){
// 최종 return :: ['c','d']
},
count_all_children_of_key: function(key){
// key가 c일때 최종 return :: 4
// key가 a일때 최종 return :: 10
}
}
})
문제 2
- 두개의 컴포넌트로 아래의 화면을 만드세요
- 아래의 json 파일로 데이터 사용
- 이름의 리스트는 굳이 라디오 버튼 안써도 되고 선택가능하게 만드시면 됩니다.
- 입사일의 날짜 포맷 버튼은 라디오 버튼으로 사용하여도 되고 토글 가능한 컴포넌트면 상관 없습니다
data.json
