-
title1
-
title2
-
title3
+
title1
+
title2
+
title3
diff --git a/src/tab/test/index.spec.js b/src/tab/test/index.spec.js
index 55f8f408c..02a66f49b 100644
--- a/src/tab/test/index.spec.js
+++ b/src/tab/test/index.spec.js
@@ -239,3 +239,27 @@ test('title-style prop', () => {
expect(wrapper.find('.van-tab').element.style.color).toEqual('red');
});
+
+test('dot prop', () => {
+ const wrapper = mount({
+ template: `
+
+ Text
+
+ `
+ });
+
+ expect(wrapper).toMatchSnapshot();
+});
+
+test('info prop', () => {
+ const wrapper = mount({
+ template: `
+
+ Text
+
+ `
+ });
+
+ expect(wrapper).toMatchSnapshot();
+});
diff --git a/src/tabs/Title.js b/src/tabs/Title.js
index 2b3576991..2f6043284 100644
--- a/src/tabs/Title.js
+++ b/src/tabs/Title.js
@@ -1,10 +1,13 @@
import { createNamespace } from '../utils';
+import Info from '../info';
const [createComponent, bem] = createNamespace('tab');
export default createComponent({
props: {
+ dot: Boolean,
type: String,
+ info: [Number, String],
color: String,
title: String,
isActive: Boolean,
@@ -59,16 +62,22 @@ export default createComponent({
-
+
{this.slots() || this.title}
+
);
diff --git a/src/tabs/index.js b/src/tabs/index.js
index 058c6b470..1a5eac26e 100644
--- a/src/tabs/index.js
+++ b/src/tabs/index.js
@@ -269,6 +269,8 @@ export default createComponent({
ref="titles"
refInFor
type={type}
+ dot={item.dot}
+ info={item.info}
title={item.title}
color={this.color}
style={item.titleStyle}
diff --git a/src/tabs/index.less b/src/tabs/index.less
index 01384b596..649e66876 100644
--- a/src/tabs/index.less
+++ b/src/tabs/index.less
@@ -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 {