tabs组件导航区添加右侧slot功能及修改例子文件

This commit is contained in:
H 2017-03-27 13:28:37 +08:00
parent 5e7ad5e05a
commit c4eb5dcffd
3 changed files with 36 additions and 7 deletions

View file

@ -12,6 +12,7 @@
<Icon v-if="showClose(item)" type="ios-close-empty" @click.native.stop="handleRemove(index)"></Icon>
</div>
</div>
<div :class="[prefixCls + '-nav-right']" v-if="showSlot"><slot name="right"></slot></div>
</div>
</div>
</div>
@ -59,7 +60,8 @@
navList: [],
barWidth: 0,
barOffset: 0,
activeKey: this.value
activeKey: this.value,
showSlot:false
};
},
computed: {
@ -225,6 +227,9 @@
this.updateBar();
this.updateStatus();
}
},
mounted(){
this.showSlot = this.$slots.default !== undefined;
}
};
</script>

View file

@ -54,6 +54,10 @@
white-space: nowrap;
}
&-nav-right{
float: right;
}
&-nav {
padding-left: 0;
margin: 0;