aboutsummaryrefslogtreecommitdiff
path: root/src/components/tab_switcher/tab_switcher.jsx
diff options
context:
space:
mode:
authorRinpatch <rinpatch@sdf.org>2018-12-13 17:22:19 +0300
committerRinpatch <rinpatch@sdf.org>2018-12-13 17:22:19 +0300
commit6de4dcc7c99e14552303e5eee7dac31dd5e58e2e (patch)
tree668904f3dba16ab39f683345b2e979e57696db94 /src/components/tab_switcher/tab_switcher.jsx
parent48edc0c8fcc6c63e432c9b6d78f14af086b56900 (diff)
parent8e4777ccc6bf72b56a0905ca491c8e0e97fb73cf (diff)
Resolve merge conflict
Diffstat (limited to 'src/components/tab_switcher/tab_switcher.jsx')
-rw-r--r--src/components/tab_switcher/tab_switcher.jsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx
index 3fff38f6..9e3dee04 100644
--- a/src/components/tab_switcher/tab_switcher.jsx
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -25,11 +25,14 @@ export default Vue.component('tab-switcher', {
}
return (<button onClick={this.activateTab(index)} class={ classes.join(' ') }>{slot.data.attrs.label}</button>)
});
- const contents = (
- <div>
- {this.$slots.default.filter(slot => slot.data)[this.active]}
- </div>
- );
+ const contents = this.$slots.default.filter(_=>_.data).map(( slot, index ) => {
+ const active = index === this.active
+ return (
+ <div class={active ? 'active' : 'hidden'}>
+ {slot}
+ </div>
+ )
+ });
return (
<div class="tab-switcher">
<div class="tabs">