mirror of
https://github.com/youzan/vant.git
synced 2026-05-06 01:00:26 +08:00
feat(Tab): add dot prop (#5272)
This commit is contained in:
+14
-6
@@ -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>
|
||||
);
|
||||
|
||||
@@ -268,6 +268,7 @@ export default createComponent({
|
||||
<Title
|
||||
ref="titles"
|
||||
refInFor
|
||||
dot={item.dot}
|
||||
type={type}
|
||||
title={item.title}
|
||||
color={this.color}
|
||||
|
||||
+4
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user