提交 9cce9e73 编写于 作者: A Alfredo Sumaran

Move component visibility validation to parent component

上级 bfa37102
...@@ -10,16 +10,11 @@ export default { ...@@ -10,16 +10,11 @@ export default {
required: false, required: false,
}, },
}, },
computed: {
hasGroups() {
return Object.keys(this.groups).length > 0;
},
},
}; };
</script> </script>
<template> <template>
<ul class="content-list group-list-tree" v-show="hasGroups"> <ul class="content-list group-list-tree">
<group-item v-for="(group, index) in groups" :key="index" :group="group" :baseGroup="baseGroup" /> <group-item v-for="(group, index) in groups" :key="index" :group="group" :baseGroup="baseGroup" />
</ul> </ul>
</template> </template>
...@@ -87,6 +87,9 @@ export default { ...@@ -87,6 +87,9 @@ export default {
return fullPath; return fullPath;
}, },
hasGroups() {
return Object.keys(this.group.subGroups).length > 0;
},
}, },
}; };
</script> </script>
...@@ -161,6 +164,6 @@ export default { ...@@ -161,6 +164,6 @@ export default {
{{group.description}} {{group.description}}
</div> </div>
<group-folder v-if="group.isOpen" :groups="group.subGroups" :baseGroup="group" /> <group-folder v-if="group.isOpen && hasGroups" :groups="group.subGroups" :baseGroup="group" />
</li> </li>
</template> </template>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册