style(Tab): disable ellipsis when scrollable

This commit is contained in:
chenjiahan
2020-07-31 20:48:10 +08:00
parent 729cca61a9
commit bc0e45687a
4 changed files with 23 additions and 25 deletions
+2 -3
View File
@@ -11,7 +11,6 @@ export default createComponent({
color: String,
title: String,
isActive: Boolean,
ellipsis: Boolean,
disabled: Boolean,
scrollable: Boolean,
activeColor: String,
@@ -58,7 +57,7 @@ export default createComponent({
genText() {
const Text = (
<span class={bem('text', { ellipsis: this.ellipsis })}>
<span class={bem('text', { ellipsis: !this.scrollable })}>
{this.slots() || this.title}
</span>
);
@@ -85,7 +84,7 @@ export default createComponent({
bem({
active: this.isActive,
disabled: this.disabled,
complete: !this.ellipsis,
complete: this.scrollable,
}),
]}
style={this.style}
+2 -3
View File
@@ -364,7 +364,7 @@ export default createComponent({
},
render() {
const { type, ellipsis, animated, scrollable } = this;
const { type, animated, scrollable } = this;
const Nav = this.children.map((item, index) => (
<Title
@@ -377,7 +377,6 @@ export default createComponent({
color={this.color}
style={item.titleStyle}
isActive={index === this.currentIndex}
ellipsis={ellipsis}
disabled={item.disabled}
scrollable={scrollable}
activeColor={this.titleActiveColor}
@@ -403,7 +402,7 @@ export default createComponent({
<div
ref="nav"
role="tablist"
class={bem('nav', [type, { complete: !ellipsis }])}
class={bem('nav', [type, { complete: this.scrollable }])}
style={this.navStyle}
>
{this.slots('nav-left')}