Skip to content

Commit

Permalink
feat(DaoPanel): add close button
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiao Anran committed May 9, 2018
1 parent a578017 commit eddbbb2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/dao-panel/dao-panel-nav/dao-panel-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
:key="index">
{{ name }}
</li>
<li class="dao-panel-nav-icon first" @click="changeSize('l')" :class="{ active: activeSize === 'l' }">
<li class="dao-panel-nav-icon first" @click="close">
<span class="icon">
<svg><use xlink:href="#icon_close"></use></svg>
</span>
</li>
<li class="dao-panel-nav-icon" @click="changeSize('l')" :class="{ active: activeSize === 'l' }">
<span class="icon">
<svg><use xlink:href="#icon_panel-size-large"></use></svg>
</span>
Expand Down Expand Up @@ -52,6 +57,9 @@ export default {
changeSize(size) {
this.$parent.changeSize(size);
},
close() {
this.$parent.$emit('update:visible', false);
},
},
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/dao-panel/dao-panel.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="dao-panel" :style="{ height: height + 'px', minHeight: minHeight }">
<div class="dao-panel" :style="{ height: height + 'px', minHeight: minHeight }" v-if="visible">
<div class="dao-panel-header">
<dao-panel-nav :tabList="tabList"></dao-panel-nav>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/dao-panel/dao-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export default {
default: '',
},
visible: {
type: Boolean,
default: false,
},
size: {
type: String,
default: 'm',
Expand Down

0 comments on commit eddbbb2

Please sign in to comment.