feat(Tab): add dot prop (#5272)

This commit is contained in:
neverland
2019-12-14 22:37:25 +08:00
committed by GitHub
parent a7535cc948
commit ebd69714a1
9 changed files with 125 additions and 88 deletions
+14 -6
View File
@@ -1,9 +1,11 @@
import { createNamespace } from '../utils';
import Info from '../info';
const [createComponent, bem] = createNamespace('tab');
export default createComponent({
props: {
dot: Boolean,
type: String,
color: String,
title: String,
@@ -59,16 +61,22 @@ export default createComponent({
<div
role="tab"
aria-selected={this.isActive}
class={bem({
active: this.isActive,
disabled: this.disabled,
complete: !this.ellipsis
})}
class={[
bem({
active: this.isActive,
disabled: this.disabled,
complete: !this.ellipsis
}),
{
'van-ellipsis': this.ellipsis
}
]}
style={this.style}
onClick={this.onClick}
>
<span class={{ 'van-ellipsis': this.ellipsis }}>
<span class={bem('text')}>
{this.slots() || this.title}
<Info dot={this.dot} />
</span>
</div>
);
+1
View File
@@ -268,6 +268,7 @@ export default createComponent({
<Title
ref="titles"
refInFor
dot={item.dot}
type={type}
title={item.title}
color={this.color}
+4 -4
View File
@@ -12,10 +12,6 @@
text-align: center;
cursor: pointer;
span {
display: block;
}
&--active {
color: @tab-active-text-color;
font-weight: @font-weight-bold;
@@ -24,6 +20,10 @@
&--disabled {
color: @tab-disabled-text-color;
}
&__text {
position: relative;
}
}
.van-tabs {