Skip to content

Commit

Permalink
[#734][3.0] Tree 컴포넌트 기능 개선 코드에 대한 피드백 반영
Browse files Browse the repository at this point in the history
###########
- filteredValue를 searchWord로 변경
- 오타 수정
- 선언된 변수 활용하도록 수정
  • Loading branch information
BoKyeongShin committed Feb 3, 2021
1 parent edaf66b commit b2839f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/views/tree/api/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| expand-icon | String | 'ev-icon-s-play' 아이콘을 우측으로 90도 회전한 모양 | 트리를 펼쳤을 때 보여질 아이콘 | |
| collapse-icon | String | 'ev-icon-s-play' 아이콘 | 트리를 접었을 때 보여질 아이콘 | |
| context-menu-items | Array | [] | 우클릭 시 보여지는 컨텍스트 메뉴, 사용하지 않을 경우 컨텍스트 메뉴는 보이지 않음 | |
| filtered-value | String | '' | 'ev-text-field' 컴포넌트를 사용해서 검색할 때 필터링 할 단어 | |
| search-word | String | '' | 'ev-text-field' 컴포넌트를 사용해서 검색할 때 필터링 할 단어 | |

>### Event
Expand Down
8 changes: 4 additions & 4 deletions docs/views/tree/example/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
@search="searchInput"
/>
<ev-tree
:data="searchExExData"
:data="searchExData"
:use-checkbox="true"
:filtered-value="searchValue"
:search-word="searchValue"
/>
<div class="description">
'ev-text-field' 컴포넌트를 사용해 필터링할 단어를 검색하면 'ev-tree' 컴포넌트 내부에서 검색되는 구조입니다.
Expand Down Expand Up @@ -287,7 +287,7 @@ export default {
],
},
]);
const searchExExData = ref([
const searchExData = ref([
{
title: 'Root',
expand: true,
Expand Down Expand Up @@ -419,7 +419,7 @@ export default {
disableExData,
contextmenuExData,
iconClassExData,
searchExExData,
searchExData,
menuItems,
clickedNodeInfo,
dbclickedNodeInfo,
Expand Down
12 changes: 6 additions & 6 deletions src/components/tree/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
type: Array,
default: () => [],
},
filteredValue: {
searchWord: {
type: String,
default: '',
},
Expand Down Expand Up @@ -247,9 +247,9 @@ export default {
const node = nodeObj.node;
node.visible = true;
// make children invisible, traverse down
makeChildrenInvisible(nodeObj.node);
makeChildrenInvisible(node);
// make parent visible, traverse up
const parentKey = allNodeInfo[nodeObj.node.nodeKey].parent;
const parentKey = allNodeInfo[node.nodeKey].parent;
makeParentVisible(parentKey);
});
}
Expand All @@ -260,9 +260,9 @@ export default {
});
watch(() => props.filteredValue, (newFilteredValue) => {
if (newFilteredValue) {
filterNode(newFilteredValue);
watch(() => props.searchWord, (newSearchWord) => {
if (newSearchWord) {
filterNode(newSearchWord);
} else {
allNodeInfo.forEach((nodeObj) => {
const node = nodeObj.node;
Expand Down

0 comments on commit b2839f8

Please sign in to comment.